Interface IAccessMechanics
- All Superinterfaces:
IComponent
,IInitializable
,IMechanics
,ISystemHandler
- All Known Subinterfaces:
IBasicMechanics
,IContainerContentConstraintMechanics
,IContainerMechanics
,IContentMechanics
,IFolderMechanics
,ILinkMechanics
,ILocalePortletMechanics
,IPortalRulesMechanics
,IPortletMechanics
,IRuleMechanics
,IScheduleMechanics
,ISkinMechanics
,ITaskMechanics
,ITaskScheduleMechanics
,ITemplateMechanics
,ITopicMechanics
,IVersionableMechanics
,IWebAppMechanics
,IXTypeMechanics
Mechanics for performing access checking.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Access to resource denied.static final int
Access to resource granted.static final String
Name of the IView property containing accessRightIDstatic final String
Name of the IView property containing access right long namestatic final String
Name of the IView property containing access right short namestatic final String
Alias of the container which stores all registered access rightsstatic final int
Access to resource unspecified.static final String
Anonymousstatic final String
Basic auth levelstatic final String
Default (forms) based auth levelstatic final String
Full access auth level.static final String
Kerberos auth levelstatic final String
NTLM auth levelstatic final String
Key for identifying the authLevel property. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRemoveAccess
(IThingID itemId, IThingID userId, boolean recursive) Returns true if the specified user can remove entries from the access list of the specified item.boolean
canRemoveSecurityRealm
(IThingID itemId, IThingID userId, boolean recursive) Returns true if user can remove policy from the specified itemboolean
canSetAccess
(IThingID itemId, IThingID userId, boolean recursive) Returns true if the specified user can add or modify entries in the access list of the specified item.boolean
canSetAuthentication
(IThingID itemId, IThingID userId, boolean recursive) Returns true if the specified user can set the authentication type of the specified item.boolean
canSetOwner
(IThingID itemId, IThingID userId) Returns true if the specified user can set the owner of the specified item.boolean
canSetSecurityRealm
(IThingID itemID, IThingID userID, IThingID policyID, boolean recursive) Returns true if user can set policy on the itemvoid
checkAccess
(IThingID itemId, IThingID userId, int rights, Map<?, ?> capabilities) Deprecated.void
checkAccessEx
(IThingID itemId, IThingID userId, IRightSet rightSet) Check access for a given thingID.void
checkRemoveAccess
(IThingID itemId, IThingID userId, boolean recursive) Throws aPortalAccessException
if the specified user cannot remove entries from the access list of the specified item.void
checkRemoveSecurityRealm
(IThingID itemID, IThingID userID, boolean recursive) Checks if user can remove policy from the specified item, otherwise exception will be thrownvoid
checkSetAccess
(IThingID itemId, IThingID userId, boolean recursive) Throws aPortalAccessException
if the specified user cannot add or modify entries in the access list of the specified item.void
checkSetAuthentication
(IThingID itemId, IThingID userId, boolean recursive) Throws aPortalAccessException
if the specified user cannot set the authentication type of the specified item.void
checkSetOwner
(IThingID itemId, IThingID userId) Throws aPortalAccessException
if the specified user cannot set the owner of the specified item.void
checkSetSecurityRealm
(IThingID itemID, IThingID userID, IThingID policyID, boolean recursive) Checks if user can set policy on the item, otherwise exception is thrownvoid
clone the aces from the source to the destinationvoid
fireRemoveAcccesEvent
(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds) Fires a remove access event.void
fireRemoveAcccesEvent
(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds, boolean recursive) Fires a remove access event.void
fireRemoveSecurityRealmEvent
(IThingID itemID, IThingID userID, IThingID policyID, boolean recursive) Fires an event about policy being removed from an itemvoid
fireSetAccessEvent
(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds) Fires a set access event.void
fireSetAccessEvent
(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds, boolean recursive) Fires a set access event.void
fireSetAuthenticationEvent
(IThingID itemId, IThingID userId, int status, String scheme) Fires a set authentication event.void
fireSetAuthenticationEvent
(IThingID itemId, IThingID userId, int status, String scheme, boolean recursive) Fires a set authentication event.void
fireSetOwnerEvent
(IThingID itemId, IThingID userId, int status, IThingID newOwnerId, IThingID oldOwnerId) Fires a set owner event.void
fireSetOwnerEvent
(IThingID itemId, IThingID userId, int status, IThingID newOwnerId, IThingID oldOwnerId, boolean recursive) Fires a set owner event.void
fireSetSecurityRealmEvent
(IThingID itemId, IThingID userId, IThingID policyID, boolean recursive) Fires event about setting policy on the itemint
Deprecated.usegetAccessEx(IThingID, IThingID)
insteadgetAccessEx
(IThingID itemId, IThingID userId) Returns the access right set the specified user has for the specified itemint[]
getAccessList
(IThingIDList thingIDList, IThingID userId, Map<?, ?> capabilities) Deprecated.usegetAccessListEx(IThingIDList, IThingID)
insteadgetAccessListEx
(IThingIDList thingIDList, IThingID userId) Returns an array ofIRightSet
representing the access rights granted to the specified user for the specified items.getAclView
(IThingID itemID) Returns access control list for this itemint
getAuthLevelForAuthScheme
(String authScheme) getAuthScheme
(String authSchemeName) getAuthSchemeForAuthLevel
(int level) Returns the appropriateIAuthScheme
for a specific resourceGets a list of available IThingID's who's IThing's implementIAuthScheme
Returns the current default auth schemegetRightNameForValue
(String xtypeName, int rightValue) Returns right name from given right value and xtype id.getRightsForType
(String xtypeName) Returns list view of all registered access rights for the specified xtypeint
getRightValueForName
(String xtypeName, String rightName) Returns integer right value from the registered right name.getSecurityRealm
(IThingID itemID) Returns thing ID of the policy assigned to the object.void
invalidateAcesForThing
(IThingID thingID) Invalidates access cache for the given thingvoid
invalidateAcesForUser
(IThingID userID) Invalidates mechanics acl cache for the given userlistSecurityRealmObjects
(IThingID securityRealmID) Returns list of objects that have assigned that security realm.void
removeAces
(IThingID itemId, List<? extends IURI> principalIds, boolean recursive) Removes the access entries for the specified item.void
removeSecurityRealm
(IThingID itemID, IThingID policyID, boolean recursive) Removes any assigned policies from the given itemvoid
setAces
(IThingID itemId, List<? extends IURI> principalIds, boolean recursive, int grant, int deny, int exclusive) Deprecated.void
setAcesEx
(IThingID itemId, List<? extends IURI> principalIds, boolean recursive, IRightSet grant, IRightSet deny, IRightSet exclusive) Sets the access entries of the specified item.void
setSecurityRealm
(IThingID itemID, IThingID policyID, boolean recursive) Sets policy for the given itemvoid
setSecurityRealm
(IThingID itemID, IThingID policyID, boolean recursive, boolean disableOverwrite) Sets policy for the given itemMethods 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
-
Field Details
-
ACCESS_GRANTED
static final int ACCESS_GRANTEDAccess to resource granted.- See Also:
-
ACCESS_DENIED
static final int ACCESS_DENIEDAccess to resource denied.- See Also:
-
ACCESS_UNSPECIFIED
static final int ACCESS_UNSPECIFIEDAccess to resource unspecified.- See Also:
-
AUTH_LEVEL_DEFAULT
Default (forms) based auth level'default'
-
AUTH_LEVEL_FULL_ACCESS
Full access auth level. ie: everyone has complete (full) access. Use with caution'fullAccess'
-
AUTH_LEVEL_ANONYMOUS
Anonymous'anonymous'
-
AUTH_LEVEL_BASIC
Basic auth level'basic'
-
AUTH_LEVEL_NTLM
NTLM auth level'ntlm'
-
ACCESS_RIGHTS_CONTAINER
Alias of the container which stores all registered access rights- See Also:
-
ACCESS_RIGHT_ID
Name of the IView property containing accessRightID- See Also:
-
ACCESS_RIGHT_SHORT_NAME
Name of the IView property containing access right short name- See Also:
-
ACCESS_RIGHT_LONG_NAME
Name of the IView property containing access right long name- See Also:
-
AUTH_LEVEL_PROPERTY
Key for identifying the authLevel property.- See Also:
-
AUTH_LEVEL_KERBEROS
Kerberos auth level- See Also:
-
-
Method Details
-
getAclView
Returns access control list for this item- Parameters:
itemID
-- Returns:
- list view of
IAceView
objects - Throws:
PortalException
-
getAccess
@Deprecated int getAccess(IThingID itemId, IThingID userId, Map<?, ?> capabilities) throws PortalExceptionDeprecated.usegetAccessEx(IThingID, IThingID)
insteadReturns the bit set representing the access rights the specified user has for the specified item.- Parameters:
itemId
- Item whose access is requested.userId
- User whose access to the item is requested.- Returns:
- Bit set representing the access rights the user has for the item.
- Throws:
PortalException
-
getAccessEx
Returns the access right set the specified user has for the specified item- Parameters:
itemId
- Item whose access is requested.userId
- User whose access to the item is requested.- Returns:
- complete right set for an item
- Throws:
PortalException
-
getSecurityRealm
Returns thing ID of the policy assigned to the object. May return null if there are no assigned policy- Parameters:
itemID
-- Returns:
- Throws:
PortalException
-
listSecurityRealmObjects
Returns list of objects that have assigned that security realm. May return empty list- Parameters:
securityRealmID
- thing ID of the security realm- Returns:
- Throws:
PortalException
-
getAccessList
@Deprecated int[] getAccessList(IThingIDList thingIDList, IThingID userId, Map<?, ?> capabilities) throws PortalExceptionDeprecated.usegetAccessListEx(IThingIDList, IThingID)
insteadReturns an array of bit sets representing the access rights granted to the specified user for the specified items.- Parameters:
thingIDList
- Items whose access to get.userId
- User whose access to get.- Returns:
- An array of bit sets representing the access rights.
- Throws:
PortalException
- See Also:
-
getAccessListEx
Returns an array ofIRightSet
representing the access rights granted to the specified user for the specified items.- Parameters:
thingIDList
- Items whose access to get.userId
- User whose access to get.- Returns:
- List of
IRightSet
- Throws:
PortalException
- See Also:
-
checkAccess
@Deprecated void checkAccess(IThingID itemId, IThingID userId, int rights, Map<?, ?> capabilities) throws PortalExceptionDeprecated.usecheckAccessEx(IThingID, IThingID, IRightSet)
insteadCheck access for a given thingID.- Parameters:
itemId
- The item being checked for access.userId
- The user wanting access.rights
- The requested rights (seeIAccessRight
).- Throws:
PortalException
-
checkAccessEx
Check access for a given thingID.- Parameters:
itemId
- The item being checked for access.userId
- The user wanting access.rightSet
- The requested rights .- Throws:
PortalException
-
canSetAccess
Returns true if the specified user can add or modify entries in the access list of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of userrecursive
- True if we want to recursively check the item's descendants.- Returns:
- True if the user can add or modify entries in the access list of the item, False if they can't.
- Throws:
PortalException
- if the userId is invalid.
-
canSetSecurityRealm
boolean canSetSecurityRealm(IThingID itemID, IThingID userID, IThingID policyID, boolean recursive) throws PortalException Returns true if user can set policy on the item- Parameters:
itemID
- item thing IDuserID
- user thing IDpolicyID
- policy object IDrecursive
- whether policy will be set recursive- Returns:
- Throws:
PortalException
-
checkSetAccess
void checkSetAccess(IThingID itemId, IThingID userId, boolean recursive) throws PortalException, PortalAccessException Throws aPortalAccessException
if the specified user cannot add or modify entries in the access list of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of userrecursive
- True if we want to recursively check the item's descendants.- Throws:
PortalAccessException
- if the user cannot add or modify entries in the access list of the item.PortalException
- if the userId is invalid.
-
checkSetSecurityRealm
void checkSetSecurityRealm(IThingID itemID, IThingID userID, IThingID policyID, boolean recursive) throws PortalException, PortalAccessException Checks if user can set policy on the item, otherwise exception is thrown- Parameters:
itemID
- item thing IDuserID
- user thing IDpolicyID
- policy object IDrecursive
- whether policy will be set recursive- Throws:
PortalException
PortalAccessException
-
canRemoveAccess
Returns true if the specified user can remove entries from the access list of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of userrecursive
- True if we want to recursively check the item's descendants.- Returns:
- True if the user can remove entries from the access list of the item, False if they can't.
- Throws:
PortalException
- if the userId is invalid.
-
canRemoveSecurityRealm
boolean canRemoveSecurityRealm(IThingID itemId, IThingID userId, boolean recursive) throws PortalException Returns true if user can remove policy from the specified item- Parameters:
itemId
- thing ID of the itemuserId
- user thing IDrecursive
- whether policy should be removed recursively- Returns:
- Throws:
PortalException
-
checkRemoveAccess
void checkRemoveAccess(IThingID itemId, IThingID userId, boolean recursive) throws PortalException, PortalAccessException Throws aPortalAccessException
if the specified user cannot remove entries from the access list of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of userrecursive
- True if we want to recursively check the item's descendants.- Throws:
PortalAccessException
- if the user cannot remove entries from the access list of the item.PortalException
- if the userId is invalid.
-
checkRemoveSecurityRealm
void checkRemoveSecurityRealm(IThingID itemID, IThingID userID, boolean recursive) throws PortalException, PortalAccessException Checks if user can remove policy from the specified item, otherwise exception will be thrown- Parameters:
itemID
- thing ID of the itemuserID
- user thing IDrecursive
- whether policy should be removed recursively- Throws:
PortalException
PortalAccessException
-
canSetAuthentication
boolean canSetAuthentication(IThingID itemId, IThingID userId, boolean recursive) throws PortalException Returns true if the specified user can set the authentication type of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of userrecursive
- True if we want to recursively check the item's descendants.- Returns:
- True if the user can set the authentication type of the item, False if they can't.
- Throws:
PortalException
- if the userId is invalid.
-
checkSetAuthentication
void checkSetAuthentication(IThingID itemId, IThingID userId, boolean recursive) throws PortalException, PortalAccessException Throws aPortalAccessException
if the specified user cannot set the authentication type of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of userrecursive
- True if we want to recursively check the item's descendants.- Throws:
PortalAccessException
- if the user cannot set the authentication type of the item.PortalException
- if the userId is invalid.
-
canSetOwner
Returns true if the specified user can set the owner of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of user- Returns:
- True if the user can set the owner of the item, False if they can't.
- Throws:
PortalException
- if the userId is invalid.
-
checkSetOwner
Throws aPortalAccessException
if the specified user cannot set the owner of the specified item.- Parameters:
itemId
-IURI
of itemuserId
-IThingID
of user- Throws:
PortalAccessException
- if the user cannot set the owner of the item.PortalException
- if the userId is invalid.
-
fireSetAccessEvent
void fireSetAccessEvent(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds) throws PortalException Fires a set access event.- Parameters:
itemId
- Item to whose access list entries were added or modified.userId
- User who set the access.status
- Status of the event (successful, denied, error).principalIds
- List ofIURI
s whose access was modified.- Throws:
PortalException
- if the userId is invalid.
-
fireSetAccessEvent
void fireSetAccessEvent(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds, boolean recursive) throws PortalException Fires a set access event.- Parameters:
itemId
- Item to whose access list entries were added or modified.userId
- User who set the access.status
- Status of the event (successful, denied, error).principalIds
- List ofIURI
s whose access was modified.- Throws:
PortalException
- if the userId is invalid.
-
fireSetSecurityRealmEvent
void fireSetSecurityRealmEvent(IThingID itemId, IThingID userId, IThingID policyID, boolean recursive) throws PortalException Fires event about setting policy on the item- Parameters:
itemId
- item thing IDuserId
- user ID which performed an operationpolicyID
- policy object IDrecursive
- if this was a recursive operation- Throws:
PortalException
-
fireRemoveAcccesEvent
void fireRemoveAcccesEvent(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds) throws PortalException Fires a remove access event.- Parameters:
itemId
- Item to which access list entries were removed.userId
- User who removed the access.status
- Status of the event (successful, denied, error).principalIds
- List ofIURI
s whose access was removed.- Throws:
PortalException
- if the userId is invalid.
-
fireRemoveSecurityRealmEvent
void fireRemoveSecurityRealmEvent(IThingID itemID, IThingID userID, IThingID policyID, boolean recursive) throws PortalException Fires an event about policy being removed from an item- Parameters:
itemID
- item thing IDuserID
- user thing Id who performed an operationrecursive
- whether this was a recursive- Throws:
PortalException
-
fireRemoveAcccesEvent
void fireRemoveAcccesEvent(IThingID itemId, IThingID userId, int status, List<? extends IURI> principalIds, boolean recursive) throws PortalException Fires a remove access event.- Parameters:
itemId
- Item to which access list entries were removed.userId
- User who removed the access.status
- Status of the event (successful, denied, error).principalIds
- List ofIURI
s whose access was removed.- Throws:
PortalException
- if the userId is invalid.
-
fireSetAuthenticationEvent
void fireSetAuthenticationEvent(IThingID itemId, IThingID userId, int status, String scheme) throws PortalException Fires a set authentication event.- Parameters:
itemId
- Item whose authentication scheme was set.userId
- User who set the authentication scheme.status
- Status of the event (successful, denied, error).scheme
- Name of the authentication scheme.- Throws:
PortalException
- if the userId is invalid.
-
fireSetAuthenticationEvent
void fireSetAuthenticationEvent(IThingID itemId, IThingID userId, int status, String scheme, boolean recursive) throws PortalException Fires a set authentication event.- Parameters:
itemId
- Item whose authentication scheme was set.userId
- User who set the authentication scheme.status
- Status of the event (successful, denied, error).scheme
- Name of the authentication scheme.- Throws:
PortalException
- if the userId is invalid.
-
fireSetOwnerEvent
void fireSetOwnerEvent(IThingID itemId, IThingID userId, int status, IThingID newOwnerId, IThingID oldOwnerId) throws PortalException Fires a set owner event.- Parameters:
itemId
- Item whose owner was set.userId
- User who set the owner.status
- Status of the event (successful, denied, error).newOwnerId
- New owner.oldOwnerId
- Old owner.- Throws:
PortalException
- if the userId is invalid.
-
fireSetOwnerEvent
void fireSetOwnerEvent(IThingID itemId, IThingID userId, int status, IThingID newOwnerId, IThingID oldOwnerId, boolean recursive) throws PortalException Fires a set owner event.- Parameters:
itemId
- Item whose owner was set.userId
- User who set the owner.status
- Status of the event (successful, denied, error).newOwnerId
- New owner.oldOwnerId
- Old owner.- Throws:
PortalException
- if the userId is invalid.
-
getRightsForType
Returns list view of all registered access rights for the specified xtype- Parameters:
xtypeName
-- Returns:
- Throws:
PortalException
-
getRightValueForName
Returns integer right value from the registered right name. It also resolves legacy right names like: READ, MODIFY, DELETE, MODIFY_PERMISSION, CREATE_ITEM, CREATE_CONTAINER- Parameters:
xtypeName
- xtype name or basic type name for an objectrightName
-- Returns:
- valid right value for the name or -1 if not found
- Throws:
PortalException
-
getRightNameForValue
Returns right name from given right value and xtype id. Different xtypes may share right with the same value, but have a different name- Parameters:
xtypeName
- xtype name or basic type name of an objectrightValue
- right value- Returns:
- right name as registered for given xtype or null if not found
- Throws:
PortalException
-
removeAces
void removeAces(IThingID itemId, List<? extends IURI> principalIds, boolean recursive) throws PortalException Removes the access entries for the specified item.- Parameters:
itemId
- Item whose access entries to remove.principalIds
- List ofIURI
s to remove.recursive
- True if the removal should be applied to this item's descendants.- Throws:
PortalException
-
removeSecurityRealm
void removeSecurityRealm(IThingID itemID, IThingID policyID, boolean recursive) throws PortalException Removes any assigned policies from the given item- Parameters:
itemID
- item thing IDrecursive
- whether to remove policy recursively- Throws:
PortalException
-
setAces
@Deprecated void setAces(IThingID itemId, List<? extends IURI> principalIds, boolean recursive, int grant, int deny, int exclusive) throws PortalException Deprecated.Sets the access entries of the specified item.- Parameters:
itemId
- Item whose access entries to set.principalIds
- List ofIURI
s for which to add or modify access.recursive
- True if the access modification should be applied to this item's descendants.grant
- Bit set of rights to grant.deny
- Bit set of rights to deny.exclusive
- Bit set of rights to grant exclusively.- Throws:
PortalException
- See Also:
-
setAcesEx
void setAcesEx(IThingID itemId, List<? extends IURI> principalIds, boolean recursive, IRightSet grant, IRightSet deny, IRightSet exclusive) throws PortalException Sets the access entries of the specified item.- Parameters:
itemId
- Item whose access entries to set.principalIds
- List ofIURI
s for which to add or modify access.recursive
- True if the access modification should be applied to this item's descendants.grant
- Bit set of rights to grant.deny
- Bit set of rights to deny.exclusive
- Bit set of rights to grant exclusively.delegate
- Bit set of rights that may be delegated.- Throws:
PortalException
- See Also:
-
cloneAces
clone the aces from the source to the destination- Parameters:
sourceID
-targetID
-- Throws:
PortalException
-
setSecurityRealm
Sets policy for the given item- Parameters:
itemID
- item thing IDpolicyID
- policy object IDrecursive
- whether to set policy recursively- Throws:
PortalException
-
setSecurityRealm
void setSecurityRealm(IThingID itemID, IThingID policyID, boolean recursive, boolean disableOverwrite) throws PortalException Sets policy for the given item- Parameters:
itemID
- item thing IDpolicyID
- policy object IDrecursive
- whether to set policy recursivelydisableOverwrite
- disable overwrite of policy selections- Throws:
PortalException
-
getAuthSchemeForAuthLevel
- Parameters:
level
-- Returns:
- the common name for the auth Level
- Throws:
PortalException
- if no scheme is found for that level
-
getAuthLevelForAuthScheme
- Parameters:
authScheme
-- Returns:
- the level for the common name
- Throws:
PortalException
- if no auth level is found
-
getAuthScheme
- Returns:
- auth scheme object for the common name
- Throws:
PortalException
- if no auth scheme is found
-
getAvailableAuthSchemes
Gets a list of available IThingID's who's IThing's implementIAuthScheme
- Throws:
PortalException
-
getAuthSchemeForResource
Returns the appropriateIAuthScheme
for a specific resource- Throws:
PortalException
-
getDefaultAuthScheme
Returns the current default auth scheme- Throws:
PortalException
-
invalidateAcesForUser
Invalidates mechanics acl cache for the given user- Parameters:
userID
-- Throws:
PortalException
-
invalidateAcesForThing
Invalidates access cache for the given thing- Parameters:
thingID
-- Throws:
PortalException
-
checkAccessEx(IThingID, IThingID, IRightSet)
instead