public class PermissionProviderImplementation extends java.lang.Object implements java.io.Serializable, PermissionProvider
PermissionProvider interface.| Constructor and Description |
|---|
PermissionProviderImplementation() |
| Modifier and Type | Method and 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 supported
Principals of the current eDAL system. |
static java.lang.InheritableThreadLocal<java.lang.String> |
getThreadlocalentityid()
Getter for the field
THREAD_LOCAL_ENTITY_ID. |
void |
grantPermission(java.lang.String principalType,
java.lang.String principalName,
EdalPermission edalPermission)
Grant one
EdalPermission for one Principal. |
void |
grantPermission(java.lang.String principalType,
java.lang.String principalName,
PrimaryDataEntity entity)
Grant all
EdalPermissions for one Principal. |
boolean |
isRoot(java.security.Principal principal)
Check if the
Principal is a root user. |
boolean |
isRootValidated(javax.mail.internet.InternetAddress address)
Check if the root user is already validated
|
void |
revokePermission(java.lang.String principalType,
java.lang.String principalName,
EdalPermission edalPermission)
Revoke one
EdalPermission for one Principal. |
void |
revokePermission(java.lang.String principalType,
java.lang.String principalName,
PrimaryDataEntity entity)
Revoke all
EdalPermissions for one Principal. |
void |
setPermissionObjectID(java.lang.String id)
Set the id of the current
PrimaryDataEntity 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-end
|
boolean |
validateRootUser(javax.mail.internet.InternetAddress address,
java.util.UUID uuid)
Validate the root user with the given email address and
UUID |
public static java.lang.InheritableThreadLocal<java.lang.String> getThreadlocalentityid()
THREAD_LOCAL_ENTITY_ID.public java.util.List<EdalPermission> findPermissions(java.util.Set<java.security.Principal> principalList)
EdalPermission object for a Set of
Principal objects.
A Set of Principal represent a
Subject.findPermissions in interface PermissionProviderprincipalList - a Set of Principal objects.List of all granted EdalPermission objects.public void grantPermission(java.lang.String principalType,
java.lang.String principalName,
EdalPermission edalPermission)
throws PrimaryDataEntityException
EdalPermission for one Principal.
grantPermission(Principal,Method)
Check if the Principal or the EdalPermission exists
before grant new permission.
grantPermission in interface PermissionProviderprincipalType - the type of the Principal object.principalName - the name of the Principal object.edalPermission - the EdalPermission to grant.PrimaryDataEntityException - if unable to grant EdalPermission.public void grantPermission(java.lang.String principalType,
java.lang.String principalName,
PrimaryDataEntity entity)
throws PrimaryDataEntityException
grantPermission in interface PermissionProviderprincipalType - the type of the Principal object.principalName - the name of the Principal object.entity - the PrimaryDataEntity to grant.PrimaryDataEntityException - if unable to grant EdalPermission.public boolean isRoot(java.security.Principal principal)
Principal is a root user.isRoot in interface PermissionProviderprincipal - the Principal to check.true when the Principal is a root user;
false otherwise.public void revokePermission(java.lang.String principalType,
java.lang.String principalName,
EdalPermission edalPermission)
throws PrimaryDataEntityException
EdalPermission for one Principal.revokePermission in interface PermissionProviderprincipalType - the type of the Principal object.principalName - the name of the Principal object.edalPermission - the EdalPermission to revoke.PrimaryDataEntityException - if unable to revoke EdalPermission.public void revokePermission(java.lang.String principalType,
java.lang.String principalName,
PrimaryDataEntity entity)
throws PrimaryDataEntityException
revokePermission in interface PermissionProviderprincipalType - the type of the Principal object.principalName - the name of the Principal object.entity - the PrimaryDataEntity to revoke.PrimaryDataEntityException - if unable to revoke EdalPermission.public void setPermissionObjectID(java.lang.String id)
PrimaryDataEntity object.setPermissionObjectID in interface PermissionProviderid - the id to set.public void storeRootUser(javax.security.auth.Subject subject,
javax.mail.internet.InternetAddress address,
java.util.UUID uuid)
throws EdalException
storeRootUser in interface PermissionProvidersubject - the Subject of the root useraddress - the email address of the root useruuid - the UUID of the root userEdalException - if unable to storepublic boolean validateRootUser(javax.mail.internet.InternetAddress address,
java.util.UUID uuid)
UUIDvalidateRootUser in interface PermissionProvideraddress - the email address of the root useruuid - the UUID of the root userpublic javax.mail.internet.InternetAddress getCurrentRootUser()
throws EdalException
getCurrentRootUser in interface PermissionProviderEdalException - If unable to load existing root user.public boolean isRootValidated(javax.mail.internet.InternetAddress address)
isRootValidated in interface PermissionProvideraddress - the email address of the root userpublic java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals()
throws EdalException
PermissionProviderPrincipals of the current eDAL system.getSupportedPrincipals in interface PermissionProviderPrincipalsEdalException - if unable to load Principals.