Interface DelegationInterface
-
- All Known Implementing Classes:
DelegationPolicyImpl
public interface DelegationInterfaceThe interfaceDelegationInterfacedefines an interface for delegation plugins that would register with delegation framework to manage and evaluate delegation access control privileges and permissions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPrivilege(SSOToken token, String orgName, DelegationPrivilege privilege)Adds a delegation privilege to a specific realm.SetgetManageableOrganizationNames(SSOToken token, Set organizationNames)Returns a set of realm names, based on the input parameterorganizationNames, in which the "user" has some delegation permissions.SetgetPermissions(SSOToken token, String orgName)Returns a set of permissions that a user has.SetgetPrivileges(SSOToken token, String orgName)Returns all the delegation privileges associated with a realm.SetgetSubjects(SSOToken token, String orgName, Set types, String pattern)Returns a set of selected subjects of specified types matching the pattern in the given realm.voidinitialize(SSOToken appToken, Map configParams)Initialize (or configure) theDelegationInterfaceobject.booleanisAllowed(SSOToken token, DelegationPermission permission, Map envParams)Returns a boolean value indicating if a user has the the specified permission.voidremovePrivilege(SSOToken token, String orgName, String privilegeName)Removes a delegation privilege from a specific realm.
-
-
-
Method Detail
-
initialize
void initialize(SSOToken appToken, Map configParams) throws DelegationException
Initialize (or configure) theDelegationInterfaceobject. Usually it will be initialized with the environmrnt parameters set by the system administrator. Usually it will be initialized with the environment parameters set by the system administrator.- Parameters:
appToken-SSOTokenof the administrative user.configParams- configuration parameters as aMap. The values in the map isjava.util.Set, which contains one or more configuration parameters.- Throws:
DelegationException- if an error occurred during initialization ofDelegationInterfaceinstance
-
getPrivileges
Set getPrivileges(SSOToken token, String orgName) throws SSOException, DelegationException
Returns all the delegation privileges associated with a realm.- Parameters:
token- TheSSOTokenof the requesting userorgName- The name of the realm from which the delegation privileges are fetched.- Returns:
SetofDelegationPrivilegeobjects associated with the realm.- Throws:
SSOException- if invalid or expired single-sign-on tokenDelegationException- for any abnormal condition
-
addPrivilege
void addPrivilege(SSOToken token, String orgName, DelegationPrivilege privilege) throws SSOException, DelegationException
Adds a delegation privilege to a specific realm. The permission will be added to the existing privilege in the event that this method is trying to add to an existing privilege.- Parameters:
token- TheSSOTokenof the requesting userorgName- The name of the realm to which the delegation privilege is to be added.privilege- The delegation privilege to be added.- Throws:
SSOException- if invalid or expired single-sign-on tokenDelegationException- if any abnormal condition occurred.
-
removePrivilege
void removePrivilege(SSOToken token, String orgName, String privilegeName) throws SSOException, DelegationException
Removes a delegation privilege from a specific realm.- Parameters:
token- TheSSOTokenof the requesting userorgName- The name of the realm from which the delegation privilege is to be removed.privilegeName- The name of the delegation privilege to be removed.- Throws:
SSOException- if invalid or expired single-sign-on tokenDelegationException- for any abnormal condition
-
getSubjects
Set getSubjects(SSOToken token, String orgName, Set types, String pattern) throws SSOException, DelegationException
Returns a set of selected subjects of specified types matching the pattern in the given realm. The pattern accepts "*" as the wild card for searching subjects. For example, "a*c" matches with any subject starting with a and ending with c.- Parameters:
token- TheSSOTokenof the requesting userorgName- The name of the realm from which the subjects are fetched.types- a set of subject types. e.g. ROLE, GROUP.pattern- a filter used to select the subjects.- Returns:
- a set of subjects associated with the realm.
- Throws:
SSOException- if invalid or expired single-sign-on tokenDelegationException- for any abnormal condition
-
getManageableOrganizationNames
Set getManageableOrganizationNames(SSOToken token, Set organizationNames) throws SSOException, DelegationException
Returns a set of realm names, based on the input parameterorganizationNames, in which the "user" has some delegation permissions.- Parameters:
token- TheSSOTokenof the requesting userorganizationNames- aSetof realm names.- Returns:
- a
Setof realm names in which the user has some delegation permissions. It is a subset oforganizationNames - Throws:
SSOException- if invalid or expired single-sign-on tokenDelegationException- for any abnormal condition
-
isAllowed
boolean isAllowed(SSOToken token, DelegationPermission permission, Map envParams) throws SSOException, DelegationException
Returns a boolean value indicating if a user has the the specified permission.- Parameters:
token- Single sign on token of the user evaluating permission.permission- Delegation permission to be evaluatedenvParams- Run-time environment parameters.- Returns:
- the result of the evaluation as a boolean value
- Throws:
SSOException- if single-sign-on token invalid or expired.DelegationException- for any other abnormal condition.
-
getPermissions
Set getPermissions(SSOToken token, String orgName) throws SSOException, DelegationException
Returns a set of permissions that a user has.- Parameters:
token- sso token of the user requesting permissionsorgName- The name of the realm from which the delegation permissions are fetched.- Returns:
- a
Setof permissions that a user has - Throws:
SSOException- if single-sign-on token invalid or expiredDelegationException- for any other abnormal condition
-
-