Interface IAccessService
- All Superinterfaces:
IComponent
,IInitializable
,IMetaComponent
Title:
Description: SkiLift
Copyright: Copyright (c) 2000
Company: webMethods, Inc
The Access Service controls storage and evaluation of rights
on things for each user. It maintains and Access Control List
(ACL) for each thing. This list consists of Access Control
Entries(ACE).
There are 2 basic models: Permissive and Restrictive. The main
differences is how group membership is evaluated.
The model can be changed and extended.
For details of how ACL's are evaluated refer to the SDK.
The model is set in the system registy. It is recommended
that this is set as soon after installation as possible.
Models are defined in IAccessModel
Default rights are defined in IAccessRight
You can define your own rights.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
permissive model ignores group denystatic final int
restrictive model evaluates group deny over group grant rightsstatic final int
initial state. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAccess
(IThingID thingID, IThingID userID, IRightSet rightSet) Check that a user is granted all of the rights in rightSet.boolean[]
filterList
(IThingIDList thingIDs, IThingID userID, IRightSet rightSet) Filter a list of thing IDs for a set of rights.Evaluates user's rights on thing.getAccessList
(IThingIDList thingIDs, IThingID userID) Retrieve the rights that a user has on the list of thingIDs.int
Get the access control model--mainly used for verification in tests Model should be set at startupGet the Acl for a thing.getAclView
(IThingID thingID) Get the Acl for a thing.getDelegatable
(IThingID thingID, IThingID userID, IRightSet rightSet) Evaluates which rights a user can delegate on this thinggetSecurityRealm
(IThingID itemID) Returns policy ID.listSecurityRealmObjects
(IThingID securityRealmID) Returns list of object IDs which have assiged to this security realm.newAce
(IThingID principalID, IRightSet grantedRights, IRightSet deniedRights, IRightSet exclusiveRights) Create a new IAcevoid
removeAces
(IThingID thingID, Collection<IAce> aces, boolean fRecursive) Remove the passed in Collection of aces from a thing.void
removeSecurityRealm
(IThingID itemID, boolean fRecursive) Unsets policy object from the given item.void
setAccessModel
(int model) Set the access control model (usually permissive or restrictive).void
setAces
(IThingID thingID, Collection<IAce> aces, boolean fRecursive) Set the passed in Collection of aces on a thing.void
setSecurityRealm
(IThingID itemID, IThingID policyObjectID, boolean fRecursive) Assigns policy object for the given item.void
setSecurityRealm
(IThingID itemID, IThingID policyObjectID, boolean fRecursive, boolean disableOverwrite) Assigns policy object for the given item.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.service.meta2.IMetaComponent
getMetaContext, setMetaContext
-
Field Details
-
MODEL_UNSET
static final int MODEL_UNSETinitial state. Access checks will fail- See Also:
-
MODEL_PERMISSIVE
static final int MODEL_PERMISSIVEpermissive model ignores group deny- See Also:
-
MODEL_RESTRICTIVE
static final int MODEL_RESTRICTIVErestrictive model evaluates group deny over group grant rights- See Also:
-
-
Method Details
-
setAccessModel
Set the access control model (usually permissive or restrictive).- Parameters:
model
- IAccessRight constant- Throws:
MetaException
- if invalid model ID
-
getAccessModel
Get the access control model--mainly used for verification in tests Model should be set at startup- Returns:
- Access model ID
- Throws:
MetaException
- if invalid model ID
-
getAllRights
IRightSet getAllRights()- Returns:
- int the full bitset of all rights (usually IAccessRight.ALL unless more rights have been added)
-
getAccess
Evaluates user's rights on thing.- Parameters:
thingID
- thing to checkuserID
- user contextrightSet
- rights to check- Returns:
- bitset of the user's allowed rights for a given thing.
- Throws:
MetaException
- on DB error or no model set
-
getDelegatable
IRightSet getDelegatable(IThingID thingID, IThingID userID, IRightSet rightSet) throws MetaException Evaluates which rights a user can delegate on this thing- Parameters:
thingID
- thing to checkuserID
- user contextrightSet
- rights to check- Returns:
- bitset of the user's delegatable rights for a given thing.
- Throws:
MetaException
- on DB error or no model set
-
checkAccess
Check that a user is granted all of the rights in rightSet.- Parameters:
thingID
- thing to checkuserID
- user contextrightSet
- rights to check- Returns:
- boolean true if user has access
- Throws:
MetaException
- on DB error or no model set
-
filterList
boolean[] filterList(IThingIDList thingIDs, IThingID userID, IRightSet rightSet) throws MetaException Filter a list of thing IDs for a set of rights.- Parameters:
thingIDs
- array of thingIDs, ignores 0userID
- user contextrightSet
- bitset of rights to check- Returns:
- boolean array corresponding to input array. Set true if access is granted for all given rights
- Throws:
MetaException
- on DB error
-
getAccessList
Retrieve the rights that a user has on the list of thingIDs.- Parameters:
thingIDs
- array of thingIDs, ignores 0userID
- user context- Returns:
- int array corresponding to input array with the rights for each thingID for the user.
- Throws:
MetaException
- on DB error
-
setAces
Set the passed in Collection of aces on a thing. Aces that already exist will not be affected, unless the principal that they apply to is the same as one of the passed in aces.- Parameters:
thingID
- The ID of a thingaces
- A Collection where the members are IAcesfRecursive
- Adds this ace to children if thingID is container- Throws:
MetaException
- on DB error
-
removeAces
Remove the passed in Collection of aces from a thing.- Parameters:
thingID
- The ID of a thingaces
- A Collection where the members are IAcesfRecursive
- removes aces to children of thingID if container- Throws:
MetaException
- on DB error
-
setSecurityRealm
void setSecurityRealm(IThingID itemID, IThingID policyObjectID, boolean fRecursive) throws MetaException Assigns policy object for the given item. When assigned policy object will control the right set for the item (any aces will be ignored)- Parameters:
itemID
- item to assign policy onpolicyObjectID
- ID of the actual policy objectfRecursive
- whether to assign this object recursively- Throws:
MetaException
-
setSecurityRealm
void setSecurityRealm(IThingID itemID, IThingID policyObjectID, boolean fRecursive, boolean disableOverwrite) throws MetaException Assigns policy object for the given item. When assigned policy object will control the right set for the item (any aces will be ignored)- Parameters:
itemID
- item to assign policy onpolicyObjectID
- ID of the actual policy objectfRecursive
- whether to assign this object recursivelydisableOverwrite
- disable overwrite of policy selections- Throws:
MetaException
-
removeSecurityRealm
Unsets policy object from the given item. When unset the right set will be controlled by aces list- Parameters:
itemID
- item to remove policy object fromfRecursive
- whether to remove it recursively- Throws:
MetaException
-
getSecurityRealm
Returns policy ID. May return null if there are no policy set on the item- Parameters:
itemID
- item thing ID- Returns:
- Throws:
MetaException
-
listSecurityRealmObjects
Returns list of object IDs which have assiged to this security realm. May return empty list- Parameters:
securityRealmID
- thing ID of the security realm- Returns:
- Throws:
MetaException
-
getAcl
Get the Acl for a thing. An Acl is simply a set of access control entries (Aces). This function is useful for looking up Aces by principals- Parameters:
thingID
- The ID of a thing.- Returns:
- HashMap where the keys are the ThingIDs of principals, and the values are IAces
- Throws:
MetaException
- If thingID not found or DB error
-
getAclView
Get the Acl for a thing. An Acl is simply a set of access control entries (Aces). Sorts by group, user then CN Note that this method only returns user and group principals (because non-users don't have CN's and we can't sort) Useful for display purposes.- Parameters:
thingID
- ID of object- Returns:
- IAcl object that is ordered by group, user then by name (just name, not first/last)
- Throws:
MetaException
- If thingID not valid or DB error
-
newAce
IAce newAce(IThingID principalID, IRightSet grantedRights, IRightSet deniedRights, IRightSet exclusiveRights) Create a new IAce- Parameters:
principalID
- user or group thingIDgrantedRights
- bitset of granted rightsdeniedRights
- bitset of denied rightsexclusiveRights
- bitset of exclusive rights- Returns:
- IAce object
-