*/
public boolean isRightPermitted(BaseRight right, IPermissionEntity entity, IPermisibleResource resource) {
validateNullEntries(permissionStore);
IPermisibleResource parentResource = resource;
IPermissionEntity parentEntity = entity;
List<Permission> rights = permissionStore.getRights(parentEntity, parentResource);
while (parentResource != null) {
if (isRightPresent(rights, right)) {// means this entity is assigned
// the right
return isRightAllowedByPriority(right, rights);
} else {
while (parentEntity != null) {
if (isRightPresent(rights, right)) {
// means this entity is assigned the right
return isRightAllowedByPriority(right, rights);
}
// increase the parent entity
parentEntity = parentEntity.getParent();
rights = permissionStore.getRights(parentEntity, parentResource);
}
}
/*
* if parent is present and the parent type is not as sane as