Class XACMLAuthorizationService
java.lang.Object
org.opencastproject.authorization.xacml.XACMLAuthorizationService
- All Implemented Interfaces:
AuthorizationService
A XACML implementation of the
AuthorizationService.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SecurityServiceThe security serviceprotected WorkspaceThe workspace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) getAcl(MediaPackage mp, AclScope scope) Gets the access control list for a given scope associated with the given media package, as specified by its XACML attachments.Gets the active access control list associated with the given media package, as specified by its XACML attachments.booleanhasPermission(MediaPackage mp, String action) Determines whether the current user can take the specified action on the media package.booleanhasPermission(AccessControlList acl, String action) Determines whether the current user can take the specified action given the access control list.removeAcl(MediaPackage mp, AclScope scope) Remove the XACML of the given scope.setAcl(MediaPackage mp, AclScope scope, AccessControlList acl) Attaches the provided policies to a media package as a XACML attachment, replacing any previous policy element of the same scope.voidsetMediaPackageSerializer(MediaPackageSerializer serializer) voidsetSecurityService(SecurityService securityService) Declarative services callback to set the security service.voidsetWorkspace(Workspace workspace) Sets the workspace to use for retrieving XACML policiesprotected voidunsetMediaPackageSerializer(MediaPackageSerializer serializer)
-
Field Details
-
workspace
The workspace -
securityService
The security service
-
-
Constructor Details
-
XACMLAuthorizationService
public XACMLAuthorizationService()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) -
setMediaPackageSerializer
-
unsetMediaPackageSerializer
-
getActiveAcl
Description copied from interface:AuthorizationServiceGets the active access control list associated with the given media package, as specified by its XACML attachments. XACML attachments are evaluated in the following order:- Use episode XACML attachment if present
- Use series XACML attachment if present
- Use non-specific XACML attachment if present. Note that the usage of this is deprecated!
- Use the global default ACL
AuthorizationService.getAcl(MediaPackage, AclScope)with scope set toAclScope.Series.- Specified by:
getActiveAclin interfaceAuthorizationService- Parameters:
mp- the media package- Returns:
- the active access control list as well as the scope identifying the source of the access rules (episode, series, …).
-
getAcl
Description copied from interface:AuthorizationServiceGets the access control list for a given scope associated with the given media package, as specified by its XACML attachments. XACML attachments are evaluated in the following order:- Use episode XACML attachment if present. This applies only if scope is set to
AclScope.Episode - Use series XACML attachment if present. This applies only if scope is set to
AclScope.EpisodeorAclScope.Series - Use non-specific XACML attachment if present. Note that the usage of this is deprecated!
- Use the global default ACL
- Specified by:
getAclin interfaceAuthorizationService- Parameters:
mp- the media packagescope- the acl scope- Returns:
- the access control list as well as the scope identifying the source of the access rules (episode, series, …) for the given media package and scope.
- Use episode XACML attachment if present. This applies only if scope is set to
-
setAcl
public Tuple<MediaPackage,Attachment> setAcl(MediaPackage mp, AclScope scope, AccessControlList acl) throws MediaPackageException Description copied from interface:AuthorizationServiceAttaches the provided policies to a media package as a XACML attachment, replacing any previous policy element of the same scope.- Specified by:
setAclin interfaceAuthorizationService- Parameters:
mp- the media packagescope- scope of the ACLacl- the tuples of roles to actions- Returns:
- the mutated (!) media package with attached XACML policy and the XACML attachment
- Throws:
MediaPackageException
-
removeAcl
Description copied from interface:AuthorizationServiceRemove the XACML of the given scope.- Specified by:
removeAclin interfaceAuthorizationService- Parameters:
mp- the media packagescope- scope of the ACL- Returns:
- the mutated (!) media package with removed XACML policy
-
hasPermission
Description copied from interface:AuthorizationServiceDetermines whether the current user can take the specified action on the media package.- Specified by:
hasPermissionin interfaceAuthorizationService- Parameters:
mp- the media packageaction- the action (e.g. read, modify, delete)- Returns:
- whether the current user has the correct privileges to take this action
-
hasPermission
Description copied from interface:AuthorizationServiceDetermines whether the current user can take the specified action given the access control list. This is not restricted to access control lists in media packages, but works regardless of which entity the access control list belongs to.- Specified by:
hasPermissionin interfaceAuthorizationService- Parameters:
acl- the access control listaction- the action (e.g. read, modify, delete)- Returns:
- whether the current user has the correct privileges to take this action
-
setWorkspace
Sets the workspace to use for retrieving XACML policies- Parameters:
workspace- the workspace to set
-
setSecurityService
Declarative services callback to set the security service.- Parameters:
securityService- the security service
-