A named grouping of roles ( {@code Role} objects).
Whether or not a given {@code Authorization} context implies a {@code Group}object depends on the members of that {@code Group} object.
A {@code Group} object can have two kinds of members: basic andrequired . A {@code Group} object is implied by an{@code Authorization} context if all of its required members are implied andat least one of its basic members is implied.
A {@code Group} object must contain at least one basic member in order to beimplied. In other words, a {@code Group} object without any basic memberroles is never implied by any {@code Authorization} context.
A {@code User} object always implies itself.
No loop detection is performed when adding members to {@code Group} objects,which means that it is possible to create circular implications. Loop detection is instead done when roles are checked. The semantics is that if a role depends on itself (i.e., there is an implication loop), the role is not implied.
The rule that a {@code Group} object must have at least one basic member tobe implied is motivated by the following example:
group foo required members: marketing basic members: alice, bob
Privileged operations that require membership in "foo" can be performed only by "alice" and "bob", who are in marketing.
If "alice" and "bob" ever transfer to a different department, anybody in marketing will be able to assume the "foo" role, which certainly must be prevented. Requiring that "foo" (or any {@code Group} object for that matter)must have at least one basic member accomplishes that.
However, this would make it impossible for a {@code Group} object to beimplied by just its required members. An example where this implication might be useful is the following declaration: "Any citizen who is an adult is allowed to vote." An intuitive configuration of "voter" would be:
group voter required members: citizen, adult basic members:
However, according to the above rule, the "voter" role could never be assumed by anybody, since it lacks any basic members. In order to address this issue a predefined role named "user.anyone" can be specified, which is always implied. The desired implication of the "voter" group can then be achieved by specifying "user.anyone" as its basic member, as follows:
group voter required members: citizen, adult basic members: user.anyone
@noimplement
@author $Id: 0ffc7e843ca60afab2965c46dc352af62f540cee $