org.sakaiproject.component.legacy.authzGroup
Interface BaseAuthzGroupService.Storage

All Known Implementing Classes:
DbAuthzGroupService.DbStorage
Enclosing interface:
BaseAuthzGroupService

protected static interface BaseAuthzGroupService.Storage

Storage


Method Summary
 boolean check(String id)
          Check if an AuthzGroup by this id exists.
 void close()
          Close.
 void completeGet(BaseAuthzGroup azGroup)
          Complete the read process once the basic AuthzGroup info has been read.
 int countAuthzGroups(String criteria)
          Count the AuthzGroup objets that meet specified criteria.
 AuthzGroup get(String id)
          Get the AuthzGroup with this id, or null if not found.
 Set getAllowedFunctions(String role, Collection azGroups)
          Get the set of functions that users with this role in these AuthzGroups are allowed to perform.
 List getAuthzGroups(String criteria, PagingPosition page)
          Access a list of AuthzGroups that meet specified criteria, naturally sorted.
 Set getAuthzGroupsIsAllowed(String userId, String function, Collection azGroups)
          Get the set of AuthzGroup ids in which this user is allowed to perform this function.
 String getUserRole(String userId, String azGroupId)
          Get the role name for this user in this AuthzGroup.
 Set getUsersIsAllowed(String function, Collection azGroups)
          Get the set of user ids of users who are allowed to perform the function in the named AuthzGroups.
 Map getUsersRole(Collection userIds, String azGroupId)
          Get the role name for each user in the userIds Collection in this AuthzGroup.
 boolean isAllowed(String userId, String function, Collection realms)
          Test if this user is allowed to perform the function in the named AuthzGroups.
 boolean isAllowed(String userId, String function, String azGroupId)
          Test if this user is allowed to perform the function in the named AuthzGroup.
 void open()
          Open.
 AuthzGroup put(String id)
          Add a new AuthzGroup with this id.
 void refreshAuthzGroup(BaseAuthzGroup azGroup)
          Refresh the external user - role membership for this AuthzGroup
 void refreshUser(String userId, Map providerMembership)
          Refresh this user's roles in any AuthzGroup that has an entry in the map; the user's new role is in the map.
 void remove(AuthzGroup azGroup)
          Remove this AuthzGroup.
 void save(AuthzGroup azGroup)
          Save the changes to the AuthzGroup
 

Method Detail

open

public void open()
Open.


close

public void close()
Close.


check

public boolean check(String id)
Check if an AuthzGroup by this id exists.

Parameters:
id - The AuthzGroup id.
Returns:
true if an AuthzGroup by this id exists, false if not.

get

public AuthzGroup get(String id)
Get the AuthzGroup with this id, or null if not found.

Parameters:
id - The AuthzGroup id.
Returns:
The AuthzGroup with this id, or null if not found.

put

public AuthzGroup put(String id)
Add a new AuthzGroup with this id.

Parameters:
id - The AuthzGroup id.
Returns:
The new AuthzGroup, or null if the id is in use.

save

public void save(AuthzGroup azGroup)
Save the changes to the AuthzGroup

Parameters:
azGroup - The AuthzGroup to save.

remove

public void remove(AuthzGroup azGroup)
Remove this AuthzGroup.

Parameters:
azGroup - The azGroup to remove.

getAuthzGroups

public List getAuthzGroups(String criteria,
                           PagingPosition page)
Access a list of AuthzGroups that meet specified criteria, naturally sorted.

Parameters:
criteria - Selection criteria: AuthzGroups returned will match this string somewhere in their id, or provider group id.
page - The PagePosition subset of items to return.
Returns:
The List (AuthzGroup) of AuthzGroups that meet specified criteria.

countAuthzGroups

public int countAuthzGroups(String criteria)
Count the AuthzGroup objets that meet specified criteria.

Parameters:
criteria - Selection criteria: realms returned will match this string somewhere in their id, or provider group id.
Returns:
The count of AuthzGroups that meet specified criteria.

completeGet

public void completeGet(BaseAuthzGroup azGroup)
Complete the read process once the basic AuthzGroup info has been read.

Parameters:
azGroup - The AuthzGroup to complete.

isAllowed

public boolean isAllowed(String userId,
                         String function,
                         String azGroupId)
Test if this user is allowed to perform the function in the named AuthzGroup.

Parameters:
userId - The user id.
function - The function to open.
azGroupId - The AuthzGroup id to consult, if it exists.
Returns:
true if this user is allowed to perform the function in the named AuthzGroup, false if not.

isAllowed

public boolean isAllowed(String userId,
                         String function,
                         Collection realms)
Test if this user is allowed to perform the function in the named AuthzGroups.

Parameters:
userId - The user id.
function - The function to open.
Returns:
true if this user is allowed to perform the function in the named AuthzGroups, false if not.

getUsersIsAllowed

public Set getUsersIsAllowed(String function,
                             Collection azGroups)
Get the set of user ids of users who are allowed to perform the function in the named AuthzGroups.

Parameters:
function - The function to check.
azGroups - A collection of the ids of AuthzGroups to consult.
Returns:
the Set (String) of user ids of users who are allowed to perform the function in the named AuthzGroups.

getAllowedFunctions

public Set getAllowedFunctions(String role,
                               Collection azGroups)
Get the set of functions that users with this role in these AuthzGroups are allowed to perform.

Parameters:
role - The role name.
azGroups - A collection of AuthzGroup ids to consult.
Returns:
the Set (String) of functions that users with this role in these AuthzGroups are allowed to perform

getAuthzGroupsIsAllowed

public Set getAuthzGroupsIsAllowed(String userId,
                                   String function,
                                   Collection azGroups)
Get the set of AuthzGroup ids in which this user is allowed to perform this function.

Parameters:
userId - The user id.
function - The function to check.
azGroups - The Collection of AuthzGroup ids to search; if null, search them all.
Returns:
the Set (String) of AuthzGroup ids in which this user is allowed to perform this function.

getUserRole

public String getUserRole(String userId,
                          String azGroupId)
Get the role name for this user in this AuthzGroup.

Parameters:
userId - The user id.
azGroupId - The AuthzGroup id to consult, if it exists.
Returns:
the role name for this user in this AuthzGroup, if the user has active membership, or null if not.

getUsersRole

public Map getUsersRole(Collection userIds,
                        String azGroupId)
Get the role name for each user in the userIds Collection in this AuthzGroup.

Parameters:
azGroupId - The AuthzGroup id to consult, if it exists.
Returns:
A Map (userId -> role name) of role names for each user who have active membership; if the user does not, it will not be in the Map.

refreshUser

public void refreshUser(String userId,
                        Map providerMembership)
Refresh this user's roles in any AuthzGroup that has an entry in the map; the user's new role is in the map.

Parameters:
userId - The user id
providerMembership - The Map of external group id -> role id.

refreshAuthzGroup

public void refreshAuthzGroup(BaseAuthzGroup azGroup)
Refresh the external user - role membership for this AuthzGroup

Parameters:
azGroup - The azGroup to refresh.