Class PermissionProviderImplementation

    • Constructor Detail

      • PermissionProviderImplementation

        public PermissionProviderImplementation()
    • Method Detail

      • getThreadlocalentityid

        public static java.lang.InheritableThreadLocal<java.lang.String> getThreadlocalentityid()
        Getter for the field THREAD_LOCAL_ENTITY_ID.
        Returns:
        the THREAD_LOCAL_ENTITY_ID
      • findPermissions

        public java.util.List<EdalPermission> findPermissions​(java.util.Set<java.security.Principal> principalList)
        Provides all granted EdalPermission object for a Set of Principal objects. A Set of Principal represent a Subject.
        Specified by:
        findPermissions in interface PermissionProvider
        Parameters:
        principalList - a Set of Principal objects.
        Returns:
        a List of all granted EdalPermission objects.
      • isRoot

        public boolean isRoot​(java.security.Principal principal)
        Check if the Principal is a root user.
        Specified by:
        isRoot in interface PermissionProvider
        Parameters:
        principal - the Principal to check.
        Returns:
        true when the Principal is a root user; false otherwise.
      • storeRootUser

        public 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
        Specified by:
        storeRootUser in interface PermissionProvider
        Parameters:
        subject - the Subject of the root user
        address - the email address of the root user
        uuid - the UUID of the root user
        Throws:
        EdalException - if unable to store
      • validateRootUser

        public boolean validateRootUser​(javax.mail.internet.InternetAddress address,
                                        java.util.UUID uuid)
        Validate the root user with the given email address and UUID
        Specified by:
        validateRootUser in interface PermissionProvider
        Parameters:
        address - the email address of the root user
        uuid - the UUID of the root user
        Returns:
        true if the user is valid, otherwise false
      • getCurrentRootUser

        public javax.mail.internet.InternetAddress getCurrentRootUser()
                                                               throws EdalException
        Load the email address of the existing root user.
        Specified by:
        getCurrentRootUser in interface PermissionProvider
        Returns:
        the email address.
        Throws:
        EdalException - If unable to load existing root user.
      • isRootValidated

        public boolean isRootValidated​(javax.mail.internet.InternetAddress address)
        Check if the root user is already validated
        Specified by:
        isRootValidated in interface PermissionProvider
        Parameters:
        address - the email address of the root user
        Returns:
        yes if the root user is already validated; no if not
      • getSupportedPrincipals

        public java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals()
                                                                                                  throws EdalException
        Description copied from interface: PermissionProvider
        Getter all supported Principals of the current eDAL system.
        Specified by:
        getSupportedPrincipals in interface PermissionProvider
        Returns:
        the list of supported Principals
        Throws:
        EdalException - if unable to load Principals.