Differences between revisions 5 and 6
Revision 5 as of 2008-06-27 13:45:18
Size: 880
Comment:
Revision 6 as of 2009-09-20 23:27:20
Size: 880
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

JSR-170 (JCR 1.0)

JSR-283 (JCR 2.0)

  • Access Control Policies
    • Abstract concept, no concrete meaning
  • Access Control Entries
    • Corresponds to a credential in Lenya
    • Grants a set of privileges to a principal (user/group/role/…)
    • Can only grant permissions, not revoke them

Examples

Set a policy on a node:

AccessControlManager acMgr = session.getAccessControlManager();

Privilege supportedPrivileges = acMgr.getSupportedPrivileges("/lenya");
Map<String,Privilege> name2privilege = mapNamesToPrivileges(supportedPrivileges);
Privilege[] privileges = {
  name2privilege.get("jcr:read"),
  name2privilege.get("jcr:write")
};

PrincipalManager principalMgr = session.getPrincipalManager();
Principal john = principalMgr.lookupPrincipal("john");

acMgr.addAccessControlEntry("/foo/bar", john, privileges);

JcrAccessControl (last edited 2009-09-20 23:27:20 by localhost)