@Named(value = "userManager#configurable")
private UserManager userManager;
- public boolean evaluate( Permission permission, Object operation, Object resource, Object principal )
+ public boolean evaluate( Permission permission, String operation, String resource, String principal )
throws PermissionEvaluationException
{
String permissionResource = permission.getResource().getIdentifier();
{
try
{
- permissionResource = userManager.findUser( principal.toString() ).getUsername();
+ permissionResource = userManager.findUser( principal ).getUsername();
}
catch ( UserNotFoundException e )
{
}
// check if this permission applies to the operation at all
- if ( permission.getOperation().getName().equals( operation.toString() ) )
+ if ( permission.getOperation().getName().equals( operation ) )
{
// check if it is a global resource, if it is then since the operations match we return true
if ( Resource.GLOBAL.equals( permission.getResource().getIdentifier() ) )
// check if the resource identifier of the permission matches the resource we are checking against
// if it does then return true
- if ( permissionResource.equals( resource.toString() ) )
+ if ( permissionResource.equals( resource ) )
{
return true;
}
*/
public interface PermissionEvaluator
{
- boolean evaluate( Permission permission, Object operation, Object resource, Object principal )
+ boolean evaluate( Permission permission, String operation, String resource, String principal )
throws PermissionEvaluationException;
}