
Jörg Hoh wrote...
Hi Jay,
Basically I agree with the documentation, that you shouldn't use "DENY", but there is one big exception to this rule: You should have a group, which grants the minimal applicable permission set. For example you model a group "login only", which only allows to login to AEM, but not to see any regular content (for example denying ALL permissions on /content/* using wildcard ACL). Make sure, that this group is the very frist group in the group list of every user.
And the you can design more groups which allow you to access specific pieces of content. Then the order of these groups does not matter anymore. Then you also don't have to rework the "login only" group, because all subtrees below /content are implicitly covered by the wildcard ACL, so you can create them at will.
(I really though, that this is covered somewhere in the official documentation ...)
kind regards,
Jörg
This keeps getting marked as the answer, but the answer really isn't here.
Here's what I'll mark as the answer:
If you're basing everything on the default contributor group (which has read access to everything in the JCR), and the only thing you need to restrict is write access to specific folders, following the official documentation is super easy: simply grant write access anywhere in the JCR that the user needs to be able to modify and boom, you're done.
If however you want to grant read access to only specific branches of a tree, you need to use denies at every level of the tree until you reach a point where everything becomes similar to the point above (i.e. the user can now read/write everything within a particular branch).
So, for example, say you have hundreds of sites published from your author cluster. Your authors would be overwhelmed (most likely) if they saw everything. Maybe you have external vendors managing content for you, and they should only have access on a "need to know basis". If this is the case, you need to lock down access to /content and /content/dam. /content/dam is a child of /content (clearly), so if you want to prevent a user from seeing all sites in /sites.html, you need to deny read access to /content, but then you need to grant it back for /content/dam.
The approach then looks like the following:
- contributor
- deny jcr:read /content rep:glob=/* (deny all read access to all children of /content, but not content itself)
- grant jcr:read /content/dam (grant read access back to /content/dam)
- deny jcr:readNodes /content/dam rep:glob=/* (now deny access to all children of /content/dam)
- Also, you might want to do similar for /apps and /etc/designs, depends on how tightly locked down you want it to be.
Contributor is used as the example base group for most of the Geometrixx samples and provides for the least amount of re-work. You might want to create a base-group that inherits from contributor to add the denies that I've added above, but you also might not want to have a group that provides full read access to the JCR by default. You now have a basic group with read access to everything except /content, which will cover most of the basic UX features of Touch-UI, but there will probably be explicit things outside that folder structure that the user might have access to but shouldn't. Also, if Adobe adds extra explicit permissions for contributor in the future, you'll get the benefit of inheriting that for your users.
Now you can create project groups with specific access to things in /content and /content/dam, and those groups should all inherit from contributor.
- contributor
- geometrixx-media-reviwer
- grant jcr:read /content/geometrixx-media
- grant jcr:read /content/dam/geometrixx-media
- geometrixx-gov-reviewer
- grant jcr:read /content/geometrixx-gov
- grant jcr:read /content/dam/geometrixx-gov
Now you can assign one or more of these groups to one or more users and they'll then only see things that they're explicitly granted access to.
But wait, my use cases are more complicated, what if my geometrixx-media project also includes some peripheral print design, I want to store my digital assets with my print assets, what do I do?
Then you'll need to push those denies further down one more level and provide a group structure to support it. For example
- contributor
- geometrixx-media-users
- grant jcr:read /content/dam/geometrixx-media
- deny jcr:readNodes /content/dam/geometrixx-media rep:glob=/*
- geometrixx-media-reviewers
- grant jcr:read /content/dam/geometrixx-media
- geometrixx-media-print-reviewers
- grant jcr:read /content/dam/geometrixx-media
- deny jcr:readNodes /content/dam/geometrixx-media rep:glob=/*
- grant jcr:read /content/dam/geometrixx-media/print
- geometrixx-media-website-reviewers
- grant jcr:read /content/geometrixx-media
- grant jcr:read /content/dam/geometrixx-media
- deny jcr:readNodes /content/dam/geometrixx-media rep:glob=/*
- grant jcr:read /content/dam/geometrixx-media/website
Unfortunately, this is due to the fact that jcr:readProperties doesn't actually do anything without also having jcr:readNodes. (jcr:read is an aggregate of jcr:readProperties and jcr:readNodes). jcr:readNodes is also badly named, it's not just "readNodes", it's "readThisNodeAndReadAllChildNodes". There's no way to do this super cleanly, you can't just grant non-recursive jcr:readProperties to a single node to allow someone to see that and nothing else, you need to also grant jcr:readNodes and then deny them on the children in order to access the node itself.
p.s. Good luck granting read access only to things that are necessary to log in. Those things are liberally spread throughout the JCR, and some things are mixed in with author-accessible content. For example, there are things in /etc/designs required for rendering Touch-UI, so you can't blanket deny /etc/designs, you need to deny things explicitly, and of course those things can change in the future. Trying to figure out the "minimum access requirements" to log into AEM is effectively just endless trial and error.