Package org.opencastproject.security.api
Interface AuthorizationService
- All Known Implementing Classes:
XACMLAuthorizationService
public interface AuthorizationService
Provides generation and interpretation of policy documents in media packages
-
Method Summary
Modifier and TypeMethodDescriptiongetAcl(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.
-
Method Details
-
hasPermission
Determines whether the current user can take the specified action on the media package.- 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
Determines 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.- 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
-
getActiveAcl
Gets 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
getAcl(MediaPackage, AclScope)with scope set toAclScope.Series.- 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
Gets 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
- 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
Tuple<MediaPackage,Attachment> setAcl(MediaPackage mp, AclScope scope, AccessControlList acl) throws MediaPackageException Attaches the provided policies to a media package as a XACML attachment, replacing any previous policy element of the same scope.- 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
Remove the XACML of the given scope.- Parameters:
mp- the media packagescope- scope of the ACL- Returns:
- the mutated (!) media package with removed XACML policy
-