// validate user
if(permission.userRequired() && user==null) {
return false;
}
// validate project
if(permission.projectRequired() && project==null) {
return false;
}
// validate resource
String[] resources = permission.value();
return permissionService.hasPermission(project, user, resources);