private void verifyPermission ( Subject subject , String permission ) throws UnauthorizedException { if ( ! subject . hasPermission ( permission ) ) { throw new UnauthorizedException ( ) ; } }
Verifies whether the user has a specific permission . If not it throws a standard UnauthorizedException .