private void addInherited(Acl acl, List<Ace> inherited, List<Integer> positions, int depth) { if ((inherited != null) && (inherited.size() > 0)) { List<Pair<Long,Integer>> aceIdsWithDepths = new ArrayList<Pair<Long,Integer>>(inherited.size()); for (int i = 0; i < inherited.size(); i++) { Ace add = inherited.get(i); Integer position = positions.get(i); aceIdsWithDepths.add(new Pair<Long, Integer>(add.getId(), position.intValue() + depth + 1)); } aclCrudDAO.addAclMembersToAcl(acl.getId(), aceIdsWithDepths); } }
Authority authority = aclCrudDAO.getAuthority(ace.getAuthorityId()); entry.setAccessStatus(ace.isAllowed() ? AccessStatus.ALLOWED : AccessStatus.DENIED); entry.setAceType(ace.getAceType()); entry.setAuthority(authority.getAuthority()); Permission perm = aclCrudDAO.getPermission(ace.getPermissionId());
Authority authority = aclCrudDAO.getAuthority(ace.getAuthorityId()); entry.setAccessStatus(ace.isAllowed() ? AccessStatus.ALLOWED : AccessStatus.DENIED); entry.setAceType(ace.getAceType()); entry.setAuthority(authority.getAuthority()); Permission perm = aclCrudDAO.getPermission(ace.getPermissionId());
private void addInherited(Acl acl, List<Ace> inherited, List<Integer> positions, int depth) { if ((inherited != null) && (inherited.size() > 0)) { List<Pair<Long,Integer>> aceIdsWithDepths = new ArrayList<Pair<Long,Integer>>(inherited.size()); for (int i = 0; i < inherited.size(); i++) { Ace add = inherited.get(i); Integer position = positions.get(i); aceIdsWithDepths.add(new Pair<Long, Integer>(add.getId(), position.intValue() + depth + 1)); } aclCrudDAO.addAclMembersToAcl(acl.getId(), aceIdsWithDepths); } }
for (Ace ace : unreferenced) unrefencedAcesToDelete.add(ace.getId());
for (Ace ace : unreferenced) unrefencedAcesToDelete.add(ace.getId());
@Override protected int updateAuthorityEntity(AuthorityEntity authorityEntity) { Authority existingAuthorityEntity = getAuthority(authorityEntity.getAuthority()); if(existingAuthorityEntity != null) { for(Ace ace : getAceEntitiesByAuthority(existingAuthorityEntity.getId())) { AceEntity aceEntity = getAceEntity(ace.getId()); aceEntity.setAuthorityId(authorityEntity.getId()); updateAceEntity(aceEntity); } deleteAuthority(existingAuthorityEntity.getId()); } authorityEntity.incrementVersion(); return template.update(UPDATE_AUTHORITY, authorityEntity); }
@Override protected int updateAuthorityEntity(AuthorityEntity authorityEntity) { Authority existingAuthorityEntity = getAuthority(authorityEntity.getAuthority()); if(existingAuthorityEntity != null) { for(Ace ace : getAceEntitiesByAuthority(existingAuthorityEntity.getId())) { AceEntity aceEntity = getAceEntity(ace.getId()); aceEntity.setAuthorityId(authorityEntity.getId()); updateAceEntity(aceEntity); } deleteAuthority(existingAuthorityEntity.getId()); } authorityEntity.incrementVersion(); return template.update(UPDATE_AUTHORITY, authorityEntity); }
toAdd.add(ace.getId());
toAdd.add(ace.getId());