|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 "!".
Field Summary |
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity |
SEPARATOR |
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. |
Role |
addRole(String id,
Role other)
Create a new Role within this AuthzGroup, as a copy of this other role |
User |
getCreatedBy()
|
Time |
getCreatedTime()
|
String |
getDescription()
|
String |
getMaintainRole()
Access the name of the role to use for giving a user membership with "maintain" access. |
Member |
getMember(String userId)
Access the user's membership record for this AuthzGroup; the role, and status flags. |
Set |
getMembers()
Access all Membership records defined for this AuthzGroup. |
User |
getModifiedBy()
|
Time |
getModifiedTime()
|
String |
getProviderGroupId()
Access the group id for the GroupProvider for this AuthzGroup. |
Role |
getRole(String id)
Access a Role defined in this AuthzGroup. |
Set |
getRoles()
Access all Roles defined for this AuthzGroup. |
Set |
getRolesIsAllowed(String function)
Access all roles that have been granted permission to this function. |
Role |
getUserRole(String userId)
Access the active role for this user's membership. |
Set |
getUsers()
Access all users who have active role membership in the AuthzGroup. |
Set |
getUsersHasRole(String role)
Access all users who have an active role membership with this role. |
Set |
getUsersIsAllowed(String function)
Access all users who have an active role membership to a role that is allowed this function. |
boolean |
hasRole(String userId,
String role)
Test if this user has a membership in this AuthzGroup that has this role and is active. |
boolean |
isAllowed(String userId,
String function)
Test if this user is allowed to perform the function in this AuthzGroup. |
boolean |
isEmpty()
Is this AuthzGroup empty of any roles or membership? |
boolean |
keepIntersection(AuthzGroup other)
Adjust membership so that active members are all active in other, and inactive members are all defined in other |
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). |
Methods inherited from interface org.sakaiproject.service.legacy.entity.Edit |
getPropertiesEdit, isActiveEdit |
Methods inherited from interface org.sakaiproject.service.legacy.entity.Entity |
getId, getProperties, getReference, getReference, getUrl, getUrl, toXml |
Methods inherited from interface java.lang.Comparable |
compareTo |
Method Detail |
public void addMember(String userId, String roleId, boolean active, boolean provided)
userId
- The user.active
- The active flag.provided
- If true, from an external provider.public Role addRole(String id) throws IdUsedException
id
- The role id.
IdUsedException
- if the id is already a Role in this AuthzGroup.public Role addRole(String id, Role other) throws IdUsedException
id
- The role id.other
- The role to copy.
IdUsedException
- if the id is already a Role in this AuthzGroup.public User getCreatedBy()
public Time getCreatedTime()
public String getDescription()
public String getMaintainRole()
public Member getMember(String userId)
userId
- The user id.
public Set getMembers()
public User getModifiedBy()
public Time getModifiedTime()
public String getProviderGroupId()
public Role getRole(String id)
id
- The role id.
public Set getRoles()
public Set getRolesIsAllowed(String function)
function
- The function to check.
public Role getUserRole(String userId)
userId
- The user id.
public Set getUsers()
public Set getUsersHasRole(String role)
public Set getUsersIsAllowed(String function)
function
- The function to check.
public boolean hasRole(String userId, String role)
userId
- The user id.role
- The role name.
public boolean isAllowed(String userId, String function)
userId
- The user id.function
- The function to open.
public boolean isEmpty()
public void removeMember(String userId)
userId
- The user.public void removeMembers()
public void removeRole(String role)
role
- The role name.public void removeRoles()
public void setMaintainRole(String role)
role
- The name of the "maintain" role.public void setProviderGroupId(String id)
id
- The external group id for the GroupProvider, or null if there is to be none.public boolean keepIntersection(AuthzGroup other)
other
- The other azg to adjust to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |