/** * Calculates the permissions of the given user and his groups from the access control list.<p> * The permissions are returned as permission string in the format {{+|-}{r|w|v|c|i}}*. * * @param user the user * @param groups the groups of this user * @param roles the roles of this user * * @return a string that displays the permissions */ public String getPermissionString(CmsUser user, List<CmsGroup> groups, List<CmsRole> roles) { return getPermissions(user, groups, roles).getPermissionString(); }
/** * Calculates the permissions of the given user and his groups from the access control list.<p> * The permissions are returned as permission string in the format {{+|-}{r|w|v|c|i}}*. * * @param user the user * @param groups the groups of this user * @param roles the roles of this user * * @return a string that displays the permissions */ public String getPermissionString(CmsUser user, List groups, List roles) { return getPermissions(user, groups, roles).getPermissionString(); }
/** * Displays the access control list of a given resource.<p> * * @param resourceName the name of the resource * * @throws Exception if something goes wrong * * @see CmsObject#getAccessControlList(String) */ public void getAcl(String resourceName) throws Exception { CmsAccessControlList acList = m_cms.getAccessControlList(resourceName); Iterator principals = acList.getPrincipals().iterator(); while (principals.hasNext()) { I_CmsPrincipal p = m_cms.lookupPrincipal((CmsUUID)principals.next()); System.out.println(p.getName() + ": " + acList.getPermissions(p.getId()).getPermissionString()); } }
/** * Displays the access control list of a given resource.<p> * * @param resourceName the name of the resource * * @throws Exception if something goes wrong * * @see CmsObject#getAccessControlList(String) */ public void getAcl(String resourceName) throws Exception { CmsAccessControlList acList = m_cms.getAccessControlList(resourceName); Iterator<CmsUUID> principals = acList.getPrincipals().iterator(); while (principals.hasNext()) { I_CmsPrincipal p = m_cms.lookupPrincipal(principals.next()); m_shell.getOut().println(p.getName() + ": " + acList.getPermissions(p.getId()).getPermissionString()); } }
dbc.currentUser().getName(), requiredPermissions.getPermissionString(), permissions.getPermissionString()}));
dbc.currentUser().getName(), requiredPermissions.getPermissionString(), permissions.getPermissionString()}));