Interface PermissionProvider
-
- All Known Implementing Classes:
PermissionProviderImplementation
public interface PermissionProvider
Interface that provide all necessary functions for the security system of the eDAL API.
-
-
Method Summary
Modifier and Type Method Description java.util.List<EdalPermission>
findPermissions(java.util.Set<java.security.Principal> principalList)
javax.mail.internet.InternetAddress
getCurrentRootUser()
Load the email address of the existing root user.java.util.List<java.lang.Class<? extends java.security.Principal>>
getSupportedPrincipals()
Getter all supportedPrincipal
s of the current eDAL system.void
grantPermission(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity)
Grant allEdalPermission
s for onePrincipal
.void
grantPermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission)
Grant oneEdalPermission
for onePrincipal
.boolean
isRoot(java.security.Principal principal)
Check if thePrincipal
is a root user.boolean
isRootValidated(javax.mail.internet.InternetAddress address)
Check if the root user is already validatedvoid
revokePermission(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity)
Revoke allEdalPermission
s for onePrincipal
.void
revokePermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission)
Revoke oneEdalPermission
for onePrincipal
.void
setPermissionObjectID(java.lang.String id)
Set the id of the currentPrimaryDataEntity
object.void
storeRootUser(javax.security.auth.Subject subject, javax.mail.internet.InternetAddress address, java.util.UUID uuid)
Store a new root user to the back-endboolean
validateRootUser(javax.mail.internet.InternetAddress address, java.util.UUID uuid)
Validate the root user with the given email address andUUID
-
-
-
Method Detail
-
getSupportedPrincipals
java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals() throws EdalException
Getter all supportedPrincipal
s of the current eDAL system.- Returns:
- the list of supported
Principal
s - Throws:
EdalException
- if unable to loadPrincipal
s.
-
isRootValidated
boolean isRootValidated(javax.mail.internet.InternetAddress address)
Check if the root user is already validated- Parameters:
address
- the email address of the root user- Returns:
- yes if the root user is already validated; no if not
-
getCurrentRootUser
javax.mail.internet.InternetAddress getCurrentRootUser() throws EdalException
Load the email address of the existing root user.- Returns:
- the email address.
- Throws:
EdalException
- If unable to load existing root user.
-
validateRootUser
boolean validateRootUser(javax.mail.internet.InternetAddress address, java.util.UUID uuid)
Validate the root user with the given email address andUUID
- Parameters:
address
- the email address of the root useruuid
- theUUID
of the root user- Returns:
- true if the user is valid, otherwise false
-
storeRootUser
void storeRootUser(javax.security.auth.Subject subject, javax.mail.internet.InternetAddress address, java.util.UUID uuid) throws EdalException
Store a new root user to the back-end- Parameters:
subject
- theSubject
of the root useraddress
- the email address of the root useruuid
- theUUID
of the root user- Throws:
EdalException
- if unable to store
-
findPermissions
java.util.List<EdalPermission> findPermissions(java.util.Set<java.security.Principal> principalList)
Provides all grantedEdalPermission
object for aSet
ofPrincipal
objects. ASet
ofPrincipal
represent aSubject
.- Parameters:
principalList
- aSet
ofPrincipal
objects.- Returns:
- a
List
of all grantedEdalPermission
objects.
-
grantPermission
void grantPermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission) throws PrimaryDataEntityException
- Parameters:
principalType
- the type of thePrincipal
object.principalName
- the name of thePrincipal
object.edalPermission
- theEdalPermission
to grant.- Throws:
PrimaryDataEntityException
- if unable to grantEdalPermission
.
-
grantPermission
void grantPermission(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity) throws PrimaryDataEntityException
- Parameters:
principalType
- the type of thePrincipal
object.principalName
- the name of thePrincipal
object.entity
- thePrimaryDataEntity
to grant.- Throws:
PrimaryDataEntityException
- if unable to grantEdalPermission
.
-
isRoot
boolean isRoot(java.security.Principal principal)
Check if thePrincipal
is a root user.- Parameters:
principal
- thePrincipal
to check.- Returns:
true
when thePrincipal
is a root user;false
otherwise.
-
revokePermission
void revokePermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission) throws PrimaryDataEntityException
Revoke oneEdalPermission
for onePrincipal
.- Parameters:
principalType
- the type of thePrincipal
object.principalName
- the name of thePrincipal
object.edalPermission
- theEdalPermission
to revoke.- Throws:
PrimaryDataEntityException
- if unable to revokeEdalPermission
.
-
revokePermission
void revokePermission(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity) throws PrimaryDataEntityException
- Parameters:
principalType
- the type of thePrincipal
object.principalName
- the name of thePrincipal
object.entity
- thePrimaryDataEntity
to revoke.- Throws:
PrimaryDataEntityException
- if unable to revokeEdalPermission
.
-
setPermissionObjectID
void setPermissionObjectID(java.lang.String id)
Set the id of the currentPrimaryDataEntity
object.- Parameters:
id
- the id to set.
-
-