if (!perAPI.doesUserHavePermission(webAsset, permission, user)) {
Logger.debug(DotPortletAction.class, "_checkUserPermissions: user does not have permissions ( " + permission + " ) over this asset: " + webAsset);
List<Role> rolesPublish = perAPI.getRoles(webAsset.getInode(), PermissionAPI.PERMISSION_PUBLISH, "CMS Owner", 0, -1);
List<Role> rolesWrite = perAPI.getRoles(webAsset.getInode(), PermissionAPI.PERMISSION_WRITE, "CMS Owner", 0, -1);
Role cmsOwner;
try {
cmsOwner = APILocator.getRoleAPI().loadCMSOwnerRole();
} catch (DotDataException e) {
Logger.error(DotPortletAction.class,e.getMessage(),e);
throw new ActionException(e);
}
boolean isCMSOwner = false;
if(rolesPublish.size() > 0 || rolesWrite.size() > 0){
for (Role role : rolesPublish) {
if(role.getId().equals(cmsOwner.getId())){
isCMSOwner = true;
break;
}
}
if(!isCMSOwner){
for (Role role : rolesWrite) {
if(role.getId().equals(cmsOwner.getId())){
isCMSOwner = true;
break;
}
}
}