| org.sakaiproject.authz.api.AuthzGroup
All known Subclasses: org.sakaiproject.authz.impl.BaseAuthzGroup,
AuthzGroup | public interface AuthzGroup extends Edit,Comparable,Serializable(Code) | |
AuthzGroup is a authorization group; a group of users, each with a role, and a set of permissions of functions made to each role.
AuthzGroups can related to Entities in Sakai; The entity reference forms the AuthzGroup id.
Special AuthzGroups not related to an entity have ids that begin with a "!".
|
Method Summary | |
void | addMember(String userId, String roleId, boolean active, boolean provided) Add a member to the AuthzGroup. | Role | addRole(String id) Create a new Role within this AuthzGroup.
Parameters: id - The role id. | Role | addRole(String id, Role other) Create a new Role within this AuthzGroup, as a copy of this other role
Parameters: id - The role id. Parameters: other - The role to copy. | User | getCreatedBy() | Time | getCreatedTime() | String | getDescription() | public String | getMaintainRole() Access the name of the role to use for giving a user membership with "maintain" access. | public Member | getMember(String userId) Access the user's membership record for this AuthzGroup; the role, and status flags.
Parameters: userId - The user id. | public Set | getMembers() Access all Membership records defined for this AuthzGroup. | User | getModifiedBy() | Time | getModifiedTime() | public String | getProviderGroupId() Access the group id for the GroupProvider for this AuthzGroup. | public Role | getRole(String id) Access a Role defined in this AuthzGroup.
Parameters: id - The role id. | public Set | getRoles() Access all Roles defined for this AuthzGroup. | public Set | getRolesIsAllowed(String function) Access all roles that have been granted permission to this function.
Parameters: function - The function to check. | public Role | getUserRole(String userId) Access the active role for this user's membership.
Parameters: userId - The user id. | public Set | getUsers() Access all users who have active role membership in the AuthzGroup. | public Set | getUsersHasRole(String role) Access all users who have an active role membership with this role. | public Set | getUsersIsAllowed(String function) Access all users who have an active role membership to a role that is allowed this function.
Parameters: function - The function to check. | boolean | hasRole(String userId, String role) Test if this user has a membership in this AuthzGroup that has this role and is active.
Parameters: userId - The user id. Parameters: role - The role name. | boolean | isAllowed(String userId, String function) Test if this user is allowed to perform the function in this AuthzGroup.
Parameters: userId - The user id. Parameters: function - The function to open. | public boolean | isEmpty() | boolean | keepIntersection(AuthzGroup other) Adjust membership so that active members are all active in other, and inactive members are all defined in other
Parameters: other - The other azg to adjust to. | void | removeMember(String userId) Remove membership for for this user from the AuthzGroup. | void | removeMembers() Remove all membership from this AuthzGroup. | void | removeRole(String role) Remove this Role from this AuthzGroup. | void | removeRoles() Remove all Roles from this AuthzGroup. | void | setMaintainRole(String role) Set the role name to use for "maintain" access. | void | setProviderGroupId(String id) Set the external group id for the GroupProvider for this AuthzGroup (set to null to have none). |
addMember | void addMember(String userId, String roleId, boolean active, boolean provided)(Code) | | Add a member to the AuthzGroup.
Parameters: userId - The user. Parameters: role - The role name. Parameters: active - The active flag. Parameters: provided - If true, from an external provider. |
addRole | Role addRole(String id) throws RoleAlreadyDefinedException(Code) | | Create a new Role within this AuthzGroup.
Parameters: id - The role id. the new Role. exception: IdUsedException - if the id is already a Role in this AuthzGroup. |
addRole | Role addRole(String id, Role other) throws RoleAlreadyDefinedException(Code) | | Create a new Role within this AuthzGroup, as a copy of this other role
Parameters: id - The role id. Parameters: other - The role to copy. the new Role. exception: IdUsedException - if the id is already a Role in this AuthzGroup. |
getCreatedBy | User getCreatedBy()(Code) | | the user who created this. |
getCreatedTime | Time getCreatedTime()(Code) | | the time created. |
getDescription | String getDescription()(Code) | | a description of the item this realm applies to. |
getMaintainRole | public String getMaintainRole()(Code) | | Access the name of the role to use for giving a user membership with "maintain" access.
The name of the "maintain" role. |
getMember | public Member getMember(String userId)(Code) | | Access the user's membership record for this AuthzGroup; the role, and status flags.
Parameters: userId - The user id. The Membership record for the user in this AuthzGroup, or null if the use is not a member. |
getMembers | public Set getMembers()(Code) | | Access all Membership records defined for this AuthzGroup.
The set of Membership records (Membership) defined for this AuthzGroup. |
getModifiedBy | User getModifiedBy()(Code) | | the user who last modified this. |
getModifiedTime | Time getModifiedTime()(Code) | | the time last modified. |
getProviderGroupId | public String getProviderGroupId()(Code) | | Access the group id for the GroupProvider for this AuthzGroup.
The the group id for the GroupProvider for this AuthzGroup, or null if none defined. |
getRole | public Role getRole(String id)(Code) | | Access a Role defined in this AuthzGroup.
Parameters: id - The role id. The Role, if found, or null, if not. |
getRoles | public Set getRoles()(Code) | | Access all Roles defined for this AuthzGroup.
The set of roles (Role) defined for this AuthzGroup. |
getRolesIsAllowed | public Set getRolesIsAllowed(String function)(Code) | | Access all roles that have been granted permission to this function.
Parameters: function - The function to check. The Set of role names (String) that have been granted permission to this function. |
getUserRole | public Role getUserRole(String userId)(Code) | | Access the active role for this user's membership.
Parameters: userId - The user id. The Role for this user's membership, or null if the user has no active membership. |
getUsers | public Set getUsers()(Code) | | Access all users who have active role membership in the AuthzGroup.
The Set of users ids (String) who have active role membership in the AuthzGroup. |
getUsersHasRole | public Set getUsersHasRole(String role)(Code) | | Access all users who have an active role membership with this role.
The Set of user ids (String) who have an active role membership with this role. |
getUsersIsAllowed | public Set getUsersIsAllowed(String function)(Code) | | Access all users who have an active role membership to a role that is allowed this function.
Parameters: function - The function to check. The Set of user ids (String) who have an active role membership to a role that is allowed this function. |
hasRole | boolean hasRole(String userId, String role)(Code) | | Test if this user has a membership in this AuthzGroup that has this role and is active.
Parameters: userId - The user id. Parameters: role - The role name. true if the User has has a membership in this AuthzGroup that has this role and is active. |
isAllowed | boolean isAllowed(String userId, String function)(Code) | | Test if this user is allowed to perform the function in this AuthzGroup.
Parameters: userId - The user id. Parameters: function - The function to open. true if this user is allowed to perform the function in this AuthzGroup, false if not. |
isEmpty | public boolean isEmpty()(Code) | | Is this AuthzGroup empty of any roles or membership?
true if the AuthzGroup is empty, false if not. |
keepIntersection | boolean keepIntersection(AuthzGroup other)(Code) | | Adjust membership so that active members are all active in other, and inactive members are all defined in other
Parameters: other - The other azg to adjust to. true if any changes were made, false if not. |
removeMember | void removeMember(String userId)(Code) | | Remove membership for for this user from the AuthzGroup.
Parameters: userId - The user. |
removeMembers | void removeMembers()(Code) | | Remove all membership from this AuthzGroup.
|
removeRole | void removeRole(String role)(Code) | | Remove this Role from this AuthzGroup. Any grants of this Role in the AuthzGroup are also removed.
Parameters: role - The role name. |
removeRoles | void removeRoles()(Code) | | Remove all Roles from this AuthzGroup.
|
setMaintainRole | void setMaintainRole(String role)(Code) | | Set the role name to use for "maintain" access.
Parameters: role - The name of the "maintain" role. |
setProviderGroupId | void setProviderGroupId(String id)(Code) | | Set the external group id for the GroupProvider for this AuthzGroup (set to null to have none).
Parameters: id - The external group id for the GroupProvider, or null if there is to be none. |
|
|