Interface PermissionProvider
-
- All Known Implementing Classes:
PermissionProviderImplementation
public interface PermissionProviderInterface 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.InternetAddressgetCurrentRootUser()Load the email address of the existing root user.java.util.List<java.lang.Class<? extends java.security.Principal>>getSupportedPrincipals()Getter all supportedPrincipals of the current eDAL system.voidgrantPermission(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity)Grant allEdalPermissions for onePrincipal.voidgrantPermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission)Grant oneEdalPermissionfor onePrincipal.booleanisRoot(java.security.Principal principal)Check if thePrincipalis a root user.booleanisRootValidated(javax.mail.internet.InternetAddress address)Check if the root user is already validatedvoidrevokePermission(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity)Revoke allEdalPermissions for onePrincipal.voidrevokePermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission)Revoke oneEdalPermissionfor onePrincipal.voidsetPermissionObjectID(java.lang.String id)Set the id of the currentPrimaryDataEntityobject.voidstoreRootUser(javax.security.auth.Subject subject, javax.mail.internet.InternetAddress address, java.util.UUID uuid)Store a new root user to the back-endbooleanvalidateRootUser(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 EdalExceptionGetter all supportedPrincipals of the current eDAL system.- Returns:
- the list of supported
Principals - Throws:
EdalException- if unable to loadPrincipals.
-
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 EdalExceptionLoad 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- theUUIDof 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 EdalExceptionStore a new root user to the back-end- Parameters:
subject- theSubjectof the root useraddress- the email address of the root useruuid- theUUIDof the root user- Throws:
EdalException- if unable to store
-
findPermissions
java.util.List<EdalPermission> findPermissions(java.util.Set<java.security.Principal> principalList)
Provides all grantedEdalPermissionobject for aSetofPrincipalobjects. ASetofPrincipalrepresent aSubject.- Parameters:
principalList- aSetofPrincipalobjects.- Returns:
- a
Listof all grantedEdalPermissionobjects.
-
grantPermission
void grantPermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission) throws PrimaryDataEntityException- Parameters:
principalType- the type of thePrincipalobject.principalName- the name of thePrincipalobject.edalPermission- theEdalPermissionto 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 thePrincipalobject.principalName- the name of thePrincipalobject.entity- thePrimaryDataEntityto grant.- Throws:
PrimaryDataEntityException- if unable to grantEdalPermission.
-
isRoot
boolean isRoot(java.security.Principal principal)
Check if thePrincipalis a root user.- Parameters:
principal- thePrincipalto check.- Returns:
truewhen thePrincipalis a root user;falseotherwise.
-
revokePermission
void revokePermission(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission) throws PrimaryDataEntityExceptionRevoke oneEdalPermissionfor onePrincipal.- Parameters:
principalType- the type of thePrincipalobject.principalName- the name of thePrincipalobject.edalPermission- theEdalPermissionto 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 thePrincipalobject.principalName- the name of thePrincipalobject.entity- thePrimaryDataEntityto revoke.- Throws:
PrimaryDataEntityException- if unable to revokeEdalPermission.
-
setPermissionObjectID
void setPermissionObjectID(java.lang.String id)
Set the id of the currentPrimaryDataEntityobject.- Parameters:
id- the id to set.
-
-