Interface AuthHandler


  • public interface AuthHandler
    Handles authentication and authorization for the current logged user
    • Method Detail

      • getRequiredValues

        Collection<?> getRequiredValues​(Permission permission)
        Returns the required values to be enforced on the given permission. Required values are obtained from permissions which are granted / denied according to a collection of related entities on products. For example, the permission to perform a payment comes from having related payment types.
      • hasValue

        default boolean hasValue​(Permission permission,
                                 Object... values)
        Returns whether the logged user has access to ALL the given values for the given permission. If the permission is not related to values, returns false
      • isAdminOf

        boolean isAdminOf​(User admin,
                          BasicUser user)
        Returns whether the given user is an administrator of the given user. An administrator is never an administrator of himself.
      • isBrokerOf

        boolean isBrokerOf​(BasicUser broker,
                           BasicUser user)
        Returns whether the given user is a broker of the given user. A broker is never a broker of himself.
      • manages

        boolean manages​(BasicUser manager,
                        BasicUser basicUser)
        Returns whether the first user manages the second user. A user or any of his operators (restricted or not) always manages himself (i.e operator.manages(owner) is true).
      • permissionOptionalValue

        PermissionCheck permissionOptionalValue​(Permission permission)
        Returns a PermissionCheck which can check any type of permission and, optionally, related values. Never checks users.
      • relatesTo

        boolean relatesTo​(BasicUser basicUser,
                          BasicUser related)
        Returns whether the first user is related to (is allowed to view) the second user
      • requiresValues

        boolean requiresValues​(Permission permission)
        Returns whether the given permission would require a value check for the currently logged user