public void setAccessControlList(NodeRef nodeRef, Acl acl) { Long aclId = null; if (acl != null) { aclId = acl.getId(); } setAccessControlList(nodeRef, aclId); }
public void setAccessControlList(NodeRef nodeRef, Acl acl) { Long aclId = null; if (acl != null) { aclId = acl.getId(); } setAccessControlList(nodeRef, aclId); }
public Long getIndirectAcl(NodeRef nodeRef) { return getAccessControlList(nodeRef).getId(); }
public Long getIndirectAcl(NodeRef nodeRef) { return getAccessControlList(nodeRef).getId(); }
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); } }
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); } }
/** * {@inheritDoc} */ @Override public Long createAccessControlList() { return createAccessControlList(getDefaultProperties()).getId(); }
/** * {@inheritDoc} */ @Override public Long createAccessControlList() { return createAccessControlList(getDefaultProperties()).getId(); }
public AccessControlListProperties getAccessControlListProperties(NodeRef nodeRef) { Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef); if(acl == null) { return null; } return aclDaoComponent.getAccessControlListProperties(acl.getId()); }
public AccessControlListProperties getAccessControlListProperties(NodeRef nodeRef) { Acl acl = getACLDAO(nodeRef).getAccessControlList(nodeRef); if(acl == null) { return null; } return aclDaoComponent.getAccessControlListProperties(acl.getId()); }
public boolean getInheritParentPermissions(NodeRef nodeRef) { Acl acl = null; try { acl = getAccessControlList(nodeRef); } catch (InvalidNodeRefException e) { return INHERIT_PERMISSIONS_DEFAULT; } if (acl == null) { return INHERIT_PERMISSIONS_DEFAULT; } else { return aclDaoComponent.getAccessControlListProperties(acl.getId()).getInherits(); } }
public void deletePermissions(StoreRef storeRef, String authority) { Acl acl = getAccessControlList(storeRef); if(acl == null) { return; } acl = getMutableAccessControlList(storeRef); SimpleAccessControlEntry pattern = new SimpleAccessControlEntry(); pattern.setAuthority(authority); pattern.setPosition(Integer.valueOf(0)); aclDaoComponent.deleteAccessControlEntries(acl.getId(), pattern); }
/** * {@inheritDoc} */ @Override public Acl createLayeredAcl(Long indirectedAcl) { SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties(); properties.setAclType(ACLType.LAYERED); Acl acl = createAccessControlList(properties); long id = acl.getId(); if (indirectedAcl != null) { mergeInheritedAccessControlList(indirectedAcl, id); } return acl; }
public void deletePermissions(StoreRef storeRef, String authority) { Acl acl = getAccessControlList(storeRef); if(acl == null) { return; } acl = getMutableAccessControlList(storeRef); SimpleAccessControlEntry pattern = new SimpleAccessControlEntry(); pattern.setAuthority(authority); pattern.setPosition(Integer.valueOf(0)); aclDaoComponent.deleteAccessControlEntries(acl.getId(), pattern); }
/** * {@inheritDoc} */ @Override public Acl createLayeredAcl(Long indirectedAcl) { SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties(); properties.setAclType(ACLType.LAYERED); Acl acl = createAccessControlList(properties); long id = acl.getId(); if (indirectedAcl != null) { mergeInheritedAccessControlList(indirectedAcl, id); } return acl; }
public void setPermission(StoreRef storeRef, String authority, PermissionReference permission, boolean allow) { Acl acl = getMutableAccessControlList(storeRef); SimpleAccessControlEntry entry = new SimpleAccessControlEntry(); entry.setAuthority(authority); entry.setPermission(permission); entry.setAccessStatus(allow ? AccessStatus.ALLOWED : AccessStatus.DENIED); entry.setAceType(ACEType.ALL); entry.setPosition(Integer.valueOf(0)); aclDaoComponent.setAccessControlEntry(acl.getId(), entry); }
public void deletePermission(StoreRef storeRef, String authority, PermissionReference permission) { Acl acl = getAccessControlList(storeRef); if(acl == null) { return; } acl = getMutableAccessControlList(storeRef); SimpleAccessControlEntry pattern = new SimpleAccessControlEntry(); pattern.setAuthority(authority); pattern.setPermission(permission); pattern.setPosition(Integer.valueOf(0)); aclDaoComponent.deleteAccessControlEntries(acl.getId(), pattern); }
public void deletePermission(StoreRef storeRef, String authority, PermissionReference permission) { Acl acl = getAccessControlList(storeRef); if(acl == null) { return; } acl = getMutableAccessControlList(storeRef); SimpleAccessControlEntry pattern = new SimpleAccessControlEntry(); pattern.setAuthority(authority); pattern.setPermission(permission); pattern.setPosition(Integer.valueOf(0)); aclDaoComponent.deleteAccessControlEntries(acl.getId(), pattern); }
public void setPermission(StoreRef storeRef, String authority, PermissionReference permission, boolean allow) { Acl acl = getMutableAccessControlList(storeRef); SimpleAccessControlEntry entry = new SimpleAccessControlEntry(); entry.setAuthority(authority); entry.setPermission(permission); entry.setAccessStatus(allow ? AccessStatus.ALLOWED : AccessStatus.DENIED); entry.setAceType(ACEType.ALL); entry.setPosition(Integer.valueOf(0)); aclDaoComponent.setAccessControlEntry(acl.getId(), entry); }
/** * @param nodeRef NodeRef * @param acl Acl */ private void replaceWithCleanDefiningAcl(NodeRef nodeRef, Acl acl) { // TODO: could just clear out existing SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties(); properties = new SimpleAccessControlListProperties(); properties.setAclType(ACLType.DEFINING); properties.setInherits(Boolean.FALSE); properties.setVersioned(false); Acl newAcl = aclDaoComponent.createAccessControlList(properties); long id = newAcl.getId(); getACLDAO(nodeRef).setAccessControlList(nodeRef, newAcl); List<AclChange> changes = new ArrayList<AclChange>(); changes.addAll(getACLDAO(nodeRef).setInheritanceForChildren(nodeRef, id, acl.getInheritedAcl())); getACLDAO(nodeRef).updateChangedAcls(nodeRef, changes); aclDaoComponent.deleteAccessControlList(acl.getId()); } }