Interface AccessControlManager
- All Known Implementing Classes:
StandardAccessControlManager
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAccess(Object object, AccessPermission permission) Determines whether the current principal has a given permission on a given object.voidcheckAccess(WTCollection objects, AccessPermission permission) Determines whether the current principal has a given permission for all of the objects in the specified collection.filterObjects(ObjectVectorIfc objects, AccessPermission permission) Given a set of objects, this method constructs and returns a new set containing only objects where the current principal is granted the permission to these objects.filterObjects(QueryResult objects, AccessPermission permission) Given a set of objects (stored as a QueryResult), this method constructs and returns a new set containing only objects where the current principal is granted the permission to these objects.getMultiValuedSecurityLabel(SecurityLabeled object, String label_name) Returns the value of the specified security label for an object.Returns a map of all security labels for an object where the label names are the map keys and the Set of label values are the corresponding map values.getMultiValuedSecurityLabels(WTCollection objects) Returns the names and list of values of all security labels for a collection of objects.getSecurityLabel(SecurityLabeled object, String label_name) Deprecated.getSecurityLabels(SecurityLabeled object) Deprecated.UsegetMultiValuedSecurityLabels(SecurityLabeled)instead.getSecurityLabels(WTCollection objects) Deprecated.UsegetMultiValuedSecurityLabels(WTCollection)instead.booleanhasAccess(Object object, AccessPermission permission) Determines whether the current principal has the given access permission over the object passed as argument.booleanhasAccess(WTCollection objects, AccessPermission permission) Determines whether the current principal has the given access permission for all of the objects in the specified collection.booleanhasAccess(WTPrincipal user, Object object, AccessPermission permission) Determines whether the given principal has the given access permission over the object passed as argument.booleanhasAccess(WTPrincipal user, String type_id, AdminDomainRef domain_ref, State state, AccessPermission permission) Determines whether the given principal has the given access permission over a given type in a given domain and state.booleanhasAccess(WTPrincipal principal, WTCollection objects, AccessPermission permission) Determines whether the given principal has the given access permission for all of the objects in the specified collection.booleanReturns true if the security labels functionality is enabled and one or more of the security label values for the specified object are non-null, even if all of the security labels that have non-null values are informational markings only and do not restrict access to the object.
-
Method Details
-
checkAccess
Determines whether the current principal has a given permission on a given object. Emits theAccessControlEvent.NOT_AUTHORIZEDevent for auditing purposes and throws aNotAuthorizedExceptionif this is not the case.If the
objectparameter specifies an instance ofObjectReference, access rights are checked on the referenced object unless the reference class itself isAccessControlled.If the
NotAuthorizedExceptionthrown by this method is caught and does not result in a user's action failing due to the lack of access rights, auditing of the exception should be disabled. The current principal is determined by callingSessionContext.getEffectivePrincipal(). If no effective principal is set, thenSessionHelper.getPrincipal().
Supported API: true- Parameters:
object- object for which permissions are to be evaluatedpermission- access control permission- Returns:
- boolean
- Throws:
WTException- See Also:
-
checkAccess
Determines whether the current principal has a given permission for all of the objects in the specified collection. Emits theAccessControlEvent.NOT_AUTHORIZEDevent for auditing purposes and throws aNotAuthorizedExceptionif this is not the case.If the
objectsparameter specifies a collection that has not been inflated, access rights are checked on a copy of the collection that has been inflated with access control enforcement bypassed.If the
NotAuthorizedExceptionthrown by this method is caught and does not result in a user's action failing due to the lack of access rights, auditing of the exception should be disabled. The current principal is determined by callingSessionContext.getEffectivePrincipal(). If no effective principal is set, thenSessionHelper.getPrincipal().
Supported API: true- Parameters:
objects- objects for which permissions are to be evaluatedpermission- access control permission- Throws:
WTException- See Also:
-
hasAccess
Determines whether the current principal has the given access permission over the object passed as argument. Returns true if this is the case, false otherwise.If the
objectparameter specifies an instance ofObjectReference, access rights are checked on the referenced object unless the reference class itself isAccessControlled. The current principal is determined by callingSessionContext.getEffectivePrincipal(). If no effective principal is set, thenSessionHelper.getPrincipal().
Supported API: true- Parameters:
object- object for which permissions are to be evaluatedpermission- access control permission- Returns:
- boolean
- Throws:
WTException
-
hasAccess
Determines whether the current principal has the given access permission for all of the objects in the specified collection. Returns true if this is the case, false otherwise.If the
objectsparameter specifies a collection that has not been inflated, access rights are checked on a copy of the collection that has been inflated with access control enforcement bypassed. The current principal is determined by callingSessionContext.getEffectivePrincipal(). If no effective principal is set, thenSessionHelper.getPrincipal().
Supported API: true- Parameters:
objects- objects for which permissions are to be evaluatedpermission- access control permission- Returns:
- boolean
- Throws:
WTException
-
hasAccess
Determines whether the given principal has the given access permission over the object passed as argument. Returns true if this is the case, false otherwise.If the
objectparameter specifies an instance ofObjectReference, access rights are checked on the referenced object unless the reference class itself isAccessControlled.
Supported API: true- Parameters:
user- principal whose access rights are to be evaluatedobject- object for which permissions are to be evaluatedpermission- access control permission- Returns:
- boolean
- Throws:
WTException
-
hasAccess
boolean hasAccess(WTPrincipal principal, WTCollection objects, AccessPermission permission) throws WTException Determines whether the given principal has the given access permission for all of the objects in the specified collection. Returns true if this is the case, false otherwise.If the
objectsparameter specifies a collection that has not been inflated, access rights are checked on a copy of the collection that has been inflated with access control enforcement bypassed.
Supported API: true- Parameters:
principal- principal whose access rights are to be evaluatedobjects- objects for which permissions are to be evaluatedpermission- access control permission- Returns:
- boolean
- Throws:
WTException
-
hasAccess
boolean hasAccess(WTPrincipal user, String type_id, AdminDomainRef domain_ref, State state, AccessPermission permission) throws WTException Determines whether the given principal has the given access permission over a given type in a given domain and state. Returns true if this is the case, false otherwise. If the state parameter is null, access policies which apply to all states are used to evaluate the principal's access rights. This is intended for use with a type that does not have a state (that is, a type that is notLifeCycleManaged).The access is evaluated only taking into account access policies. For a specific object this is only part of the answer as the object may be ad hoc controlled and have an ad hoc ACL that provides additional access rights, or the object may be administratively locked, or the object may be security labeled and have labels that deny access rights. In general this method should only be used with a type that is
PolicyAccessControlledbut notAdHocControllednorSecurityLabeled.Note: If a null state parameter is specified with a type that is
LifeCycleManaged, the result does not indicate whether the user has access rights in every state. It only reflects the rights specified by rules that apply to all states. There could be a policy rule defined for a particular state that denies access rights, which would result in denial of access for that state even though a rule that applies to all states grants access.
Supported API: true- Parameters:
user- principal whose access rights are to be evaluatedtype_id- external, logical or persisted type identifierdomain_ref- reference to the domain for which policy rules are to be evaluatedstate- lifecycle statepermission- access control permission- Returns:
- boolean
- Throws:
WTInvalidParameterException- if a principal, type or domain is not specified, or if the specified type is not aPolicyAccessControlledtype or not a valid typeWTException- See Also:
-
TypedUtilityImplementation.getPersistedType(Object)ClientTypedUtility.getPersistedType(Object)TypedUtility.getPersistedType(Object)
-
filterObjects
ObjectVectorIfc filterObjects(ObjectVectorIfc objects, AccessPermission permission) throws WTException Given a set of objects, this method constructs and returns a new set containing only objects where the current principal is granted the permission to these objects.This method can be used to filter out objects for which the user has no read access after a query is performed.
Supported API: true- Parameters:
objects- set of objectspermission- access control permission- Returns:
- ObjectVectorIfc
- Throws:
WTException
-
filterObjects
Given a set of objects (stored as a QueryResult), this method constructs and returns a new set containing only objects where the current principal is granted the permission to these objects.This method can be used to filter out objects for which the user has no read access after a database query is performed.
Supported API: true- Parameters:
objects- set of objectspermission- access control permission- Returns:
- QueryResult
- Throws:
WTException
-
getSecurityLabel
Deprecated.UsegetMultiValuedSecurityLabel(SecurityLabeled, String)instead.Returns the value of the specified security label for an object. The external representation of the value will be returned if the specified security label is a custom label.
Supported API: true- Parameters:
object- object for which the security label is to be returnedlabel_name- security label name- Returns:
- String
- Throws:
WTInvalidParameterException- if an object is not specified or the specified label name is not defined in the security labels configuration fileWTRuntimeException- if any of the object's label names or values are not defined in the security labels configuration fileWTException- See Also:
-
getMultiValuedSecurityLabel
Set<String> getMultiValuedSecurityLabel(SecurityLabeled object, String label_name) throws WTException Returns the value of the specified security label for an object. The external representation of the value will be returned if the specified security label is a custom label.
Supported API: true- Parameters:
object- object for which the security label is to be returnedlabel_name- security label name- Returns:
- Set
Set of SLValues. - Throws:
WTInvalidParameterException- if an object is not specified or the specified label name is not defined in the security labels configuration fileWTRuntimeException- if any of the object's label names or values are not defined in the security labels configuration fileWTException- See Also:
-
getSecurityLabels
Deprecated.UsegetMultiValuedSecurityLabels(SecurityLabeled)instead.Returns a map of all security labels for an object where the label names are the map keys and the label values are the corresponding map values. The external representation of the values will be returned for custom security labels. If no security labels are configured for the system, an empty map is returned.
Supported API: true- Parameters:
object- object for which security labels are to be returned- Returns:
- Map<String,String>
- Throws:
WTInvalidParameterException- if an object is not specifiedWTRuntimeException- if any of the object's label names or standard label values are not defined in the security labels configuration fileWTException- See Also:
-
getMultiValuedSecurityLabels
Returns a map of all security labels for an object where the label names are the map keys and the Set of label values are the corresponding map values. The external representation of the values will be returned for custom security labels. If no security labels are configured for the system, an empty map is returned.
Supported API: true- Parameters:
object- object for which security labels are to be returned- Returns:
- Map<String,Set
> - Throws:
WTInvalidParameterException- if an object is not specifiedWTRuntimeException- if any of the object's label names or standard label values are not defined in the security labels configuration fileWTException- See Also:
-
getSecurityLabels
Deprecated.UsegetMultiValuedSecurityLabels(WTCollection)instead.Returns the names and values of all security labels for a collection of objects. The specified objects are the key set, and for each map entry key, aMap<String, String>with the names and values of an object's security labels are the map entry's value. The external representation of the values will be returned for custom security labels.
Supported API: true- Parameters:
objects- objects for which security labels are to be returned- Returns:
- WTKeyedMap
- Throws:
ClassCastException- if one or more objects in the collection are notSecurityLabeledWTInvalidParameterException- if a collection of objects is not specified or emptyWTRuntimeException- if any of the objects' label names or standard label values are not defined in the security labels configuration fileWTException- See Also:
-
getMultiValuedSecurityLabels
Returns the names and list of values of all security labels for a collection of objects. The specified objects are the key set, and for each map entry key, aMap<String, Set<String>>with the names and values of an object's security labels are the map entry's value. The external representation of the values will be returned for custom security labels.
Supported API: true- Parameters:
objects- objects for which security labels are to be returned- Returns:
- WTKeyedMap of object and Map<String,Set
> where Set will hold multiple values on SL - Throws:
ClassCastException- if one or more objects in the collection are notSecurityLabeledWTInvalidParameterException- if a collection of objects is not specified or emptyWTRuntimeException- if any of the objects' label names or standard label values are not defined in the security labels configuration fileWTException- See Also:
-
showSecurityLabelsGlyph
Returns true if the security labels functionality is enabled and one or more of the security label values for the specified object are non-null, even if all of the security labels that have non-null values are informational markings only and do not restrict access to the object. Otherwise returns false.
Supported API: true- Parameters:
object- object for which the security labels status is requested- Returns:
- boolean
- Throws:
WTInvalidParameterException- if an object is not specifiedWTException
-
getMultiValuedSecurityLabel(SecurityLabeled, String)instead.