use of org.apache.cloudstack.acl.ProjectRolePermission in project cloudstack by apache.
the class ProjectRolePermissionsDaoImpl method persist.
@Override
public ProjectRolePermissionVO persist(final ProjectRolePermissionVO item) {
item.setSortOrder(0);
final List<ProjectRolePermissionVO> permissionsList = findAllByRoleIdSorted(item.getProjectRoleId(), item.getProjectId());
if (permissionsList != null && permissionsList.size() > 0) {
ProjectRolePermission lastRule = permissionsList.get(permissionsList.size() - 1);
item.setSortOrder(lastRule.getSortOrder() + 1);
}
return super.persist(item);
}
Aggregations