Interface WarlockGrantService

  • All Implemented Interfaces:

    
    public interface WarlockGrantService
    
                        
    Authorization and revocation, which involves elevation of privilege, must be used with GrantChecker
    - Role-owned perm
    - Role-owned role
    - User-owned perm
    - user-owned role
    
    Since:

    2021-03-05

    Author:

    trydofor

    • Constructor Detail

    • Method Detail

      • grantRole

         abstract void grantRole(long roleId, @NotNull() GrantType type, @NotNull() Collection<Long> grant)

        Grant role/perm to role to give the `grant` privilege.

        Parameters:
        roleId - roleId
        type - grant type
        grant - RoleId or PermId
      • purgeRole

         abstract void purgeRole(long roleId, @NotNull() GrantType type, @NotNull() Collection<Long> grant)

        Revoke role/perm to role to remove the `grant` privilege.

        Parameters:
        roleId - roleId
        type - grant type
        grant - RoleId or PermId
      • grantUser

         abstract void grantUser(long userId, @NotNull() GrantType type, @NotNull() Collection<Long> grant)

        Grant role/perm to user to give the `grant` privilege.

        Parameters:
        userId - userId
        type - grant type
        grant - RoleId or PermId
      • purgeUser

         abstract void purgeUser(long userId, @NotNull() GrantType type, @NotNull() Collection<Long> grant)

        Revoke role/perm to user to remove the `grant` privilege.

        Parameters:
        userId - userId
        type - grant type
        grant - RoleId or PermId
      • entryUser

         abstract Map<Long, Set<Long>> entryUser(@NotNull() GrantType type, @NotNull() Collection<Long> userId)

        Get user granted privileges. return the map of RoleId/PermId to UserId

        Parameters:
        type - grant type
        userId - userId
        Returns:

        RoleId/PermId - UserId

      • entryRole

         abstract Map<Long, Set<Long>> entryRole(@NotNull() GrantType type, @NotNull() Collection<Long> roleId)

        Get role granted privileges. return the map of RoleId/PermId to UserId

        Parameters:
        type - grant type
        roleId - roleId
        Returns:

        RoleId/PermId - roleId