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)
      Provides all granted EdalPermission object for a Set of Principal objects.
      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.
      void grantPermission​(java.lang.String principalType, java.lang.String principalName, PrimaryDataEntity entity)
      Grant all EdalPermissions for one Principal.
      void grantPermission​(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission)
      Grant one EdalPermission 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, PrimaryDataEntity entity)
      Revoke all EdalPermissions for one Principal.
      void revokePermission​(java.lang.String principalType, java.lang.String principalName, EdalPermission edalPermission)
      Revoke one EdalPermission 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
    • Method Detail

      • getSupportedPrincipals

        java.util.List<java.lang.Class<? extends java.security.Principal>> getSupportedPrincipals()
                                                                                           throws EdalException
        Getter all supported Principals of the current eDAL system.
        Returns:
        the list of supported Principals
        Throws:
        EdalException - if unable to load Principals.
      • 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 and UUID
        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
      • 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 - 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
      • findPermissions

        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.
        Parameters:
        principalList - a Set of Principal objects.
        Returns:
        a List of all granted EdalPermission objects.
      • isRoot

        boolean isRoot​(java.security.Principal principal)
        Check if the Principal is a root user.
        Parameters:
        principal - the Principal to check.
        Returns:
        true when the Principal is a root user; false otherwise.
      • setPermissionObjectID

        void setPermissionObjectID​(java.lang.String id)
        Set the id of the current PrimaryDataEntity object.
        Parameters:
        id - the id to set.