/** * Returns the resource on which the specified access control entry was set.<p> * * @param entry the current access control entry * @param parents the parent resources to determine the connected resource * @return the resource name of the corresponding resource */ protected String getConnectedResource(CmsAccessControlEntry entry, Map<CmsUUID, String> parents) { CmsUUID resId = entry.getResource(); String resName = parents.get(resId); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(resName)) { return resName; } return resId.toString(); }
/** * Returns the resource on which the specified access control entry was set.<p> * * @param entry the current access control entry * @param parents the parent resources to determine the connected resource * @return the resource name of the corresponding resource */ protected String getConnectedResource(CmsAccessControlEntry entry, Map<CmsUUID, String> parents) { CmsUUID resId = entry.getResource(); String resName = parents.get(resId); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(resName)) { return resName; } return resId.toString(); }
/** * Returns the resource on which the specified access control entry was set.<p> * * @param entry the current access control entry * @param parents the parent resources to determine the connected resource * @return the resource name of the corresponding resource */ protected String getConnectedResource(CmsAccessControlEntry entry, Map parents) { CmsUUID resId = entry.getResource(); String resName = (String)parents.get(resId); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(resName)) { return resName; } return resId.toString(); }
stmt = m_sqlManager.getPreparedStatement(conn, project, "C_ACCESS_READ_ENTRY_2"); stmt.setString(1, acEntry.getResource().toString()); stmt.setString(2, acEntry.getPrincipal().toString()); dbc, project, acEntry.getResource(), acEntry.getPrincipal(), acEntry.getAllowedPermissions(), stmt.setInt(2, acEntry.getDeniedPermissions()); stmt.setInt(3, acEntry.getFlags()); stmt.setString(4, acEntry.getResource().toString()); stmt.setString(5, acEntry.getPrincipal().toString());
entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), String idValue = type + id + entry.getResource();
Query q = m_sqlManager.createQuery(dbc, project, C_ACCESS_READ_ENTRY_2); q.setParameter(1, acEntry.getResource().toString()); q.setParameter(2, acEntry.getPrincipal().toString()); q.setParameter(1, acEntry.getResource().toString()); q.setParameter(2, acEntry.getPrincipal().toString()); dbc, project, acEntry.getResource(), acEntry.getPrincipal(), acEntry.getAllowedPermissions(),
entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), String idValue = type + id + entry.getResource();
stmt = m_sqlManager.getPreparedStatement(conn, project, "C_ACCESS_READ_ENTRY_2"); stmt.setString(1, acEntry.getResource().toString()); stmt.setString(2, acEntry.getPrincipal().toString()); dbc, project, acEntry.getResource(), acEntry.getPrincipal(), acEntry.getAllowedPermissions(), stmt.setInt(2, acEntry.getDeniedPermissions()); stmt.setInt(3, acEntry.getFlags()); stmt.setString(4, acEntry.getResource().toString()); stmt.setString(5, acEntry.getPrincipal().toString());
if (ace.getPrincipal().equals(principalId)) { CmsAccessControlEntry newAce = new CmsAccessControlEntry( ace.getResource(), replacementId, ace.getAllowedPermissions(),
if (ace.getPrincipal().equals(principalId)) { CmsAccessControlEntry newAce = new CmsAccessControlEntry( ace.getResource(), replacementId, ace.getAllowedPermissions(),
/** * Helper method to add the direct ACEs for a principal.<p> * * @param principalId the principal id * @param name the principal name * @param locale the locale * * @throws CmsException if something goes wrong */ protected void addDirectEntries(CmsUUID principalId, String name, Locale locale) throws CmsException { for (CmsAccessControlEntry ace : getAces(principalId)) { for (CmsResource resource : getResources(ace.getResource())) { String credentials = Messages.get().getBundle(locale).key(Messages.GUI_CREDENTIAL_DIRECT_0); addEntry(name, credentials, getAceString(ace), resource.getRootPath()); } } }
/** * Compiles the ACL for a file or folder. * @param cms the CMS context * @param resource the resource for which to collect the ACLs * @param onlyBasic flag to only include basic ACEs * * @return the ACL for the resource * @throws CmsException if something goes wrong */ protected Acl collectAcl(CmsObject cms, CmsResource resource, boolean onlyBasic) throws CmsException { AccessControlListImpl cmisAcl = new AccessControlListImpl(); List<Ace> cmisAces = new ArrayList<Ace>(); List<CmsAccessControlEntry> aces = cms.getAccessControlEntries(resource.getRootPath(), true); for (CmsAccessControlEntry ace : aces) { boolean isDirect = ace.getResource().equals(resource.getResourceId()); CmsUUID principalId = ace.getPrincipal(); String principalName = getAcePrincipalName(cms, principalId); AccessControlEntryImpl cmisAce = new AccessControlEntryImpl(); AccessControlPrincipalDataImpl cmisPrincipal = new AccessControlPrincipalDataImpl(); cmisPrincipal.setId(principalName); cmisAce.setPrincipal(cmisPrincipal); cmisAce.setPermissions(onlyBasic ? getCmisPermissions(ace) : getNativePermissions(ace)); cmisAce.setDirect(isDirect); cmisAces.add(cmisAce); } cmisAcl.setAces(cmisAces); cmisAcl.setExact(Boolean.FALSE); return cmisAcl; }
for (CmsGroup group : m_cms.getGroupsOfUser(user.getName(), false)) { for (CmsAccessControlEntry ace : getAces(group.getId())) { for (CmsResource resource : getResources(ace.getResource())) { String credentials = Messages.get().getBundle(locale).key( Messages.GUI_CREDENTIAL_GROUP_1, for (CmsResource resource : getResources(ace.getResource())) { String credentials = Messages.get().getBundle(locale).key( Messages.GUI_CREDENTIAL_ROLE_1,
entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(),