Class MemoryTypedAuthzCombo

  • All Implemented Interfaces:
    org.springframework.core.Ordered , pro.fessional.wings.warlock.service.auth.impl.ComboWarlockAuthzService.Combo

    
    public class MemoryTypedAuthzCombo
     implements ComboWarlockAuthzService.Combo
                        

    Add/remove auth by username and authType. Role and Perm are not distinguished, and the Role need a fixed prefix.

    Since:

    2021-03-05

    Author:

    trydofor

    • Constructor Detail

      • MemoryTypedAuthzCombo

        MemoryTypedAuthzCombo()
    • Method Detail

      • addAuthz

         void addAuthz(long userId, @NotNull() Array<String> authz)

        Add Perm/Role to userId

        Parameters:
        userId - user id
        authz - Perm/Role
      • addAuthz

         void addAuthz(long userId, @NotNull() Collection<String> authz)

        Add Perm/Role to userId

        Parameters:
        userId - user id
        authz - Perm/Role
      • addAuthz

         void addAuthz(@NotNull() String username, @NotNull() Array<String> authz)

        Add Perm/Role to user by username

        Parameters:
        username - login username
        authz - Perm/Role
      • addAuthz

         void addAuthz(@NotNull() String username, @NotNull() Collection<String> authz)

        Add Perm/Role to user by username

        Parameters:
        username - login username
        authz - Perm/Role
      • addAuthz

         void addAuthz(@NotNull() String username, Enum<out Object> authType, @NotNull() Array<String> authz)

        Add Perm/Role to user by username and authType

        Parameters:
        username - login username
        authType - only username if null
        authz - Perm/Role
      • addAuthz

         void addAuthz(@NotNull() String username, Enum<out Object> authType, @NotNull() Collection<String> authz)

        Add Perm/Role to user by username and authType

        Parameters:
        username - login username
        authType - only username if null
        authz - Perm/Role
      • delAuthz

         void delAuthz(long userId)

        delete all Perm/Role of userId

      • delAuthz

         void delAuthz(long userId, @NotNull() Collection<String> authz)

        delete given Perm/Role of userId

        Parameters:
        userId - userid
        authz - given Perm/Role
      • delAuthz

         void delAuthz(@NotNull() String username)

        delete all Perm/Role of user by login username

      • delAuthz

         void delAuthz(@NotNull() String username, @NotNull() Collection<String> authz)

        delete given Perm/Role of user by login username

        Parameters:
        username - login username
        authz - given Perm/Role
      • delAuthz

         void delAuthz(@NotNull() String username, Enum<out Object> authType)

        delete all Perm/Role of user by login username and authType

        Parameters:
        username - login username
        authType - only username if null
      • delAuthz

         void delAuthz(@NotNull() String username, Enum<out Object> authType, @NotNull() Collection<String> authz)

        delete given Perm/Role of user by login username and authType

        Parameters:
        username - login username
        authType - only username if null
        authz - given Perm/Role
      • preAuth

         boolean preAuth(@NotNull() DefaultWingsUserDetails details, @NotNull() HashSet<Object> role, @NotNull() HashSet<Object> perm)

        Prepare data for unified processing of roles and perm, e.g. modify role and perm. Return `true` for solo processing, stopping any subsequent Combo (sort by Order), such as directly specify the permissions, no subsequent additions,

        Parameters:
        details - details with/without GrantedAuthority
        role - id(Long), name(String) or Auth(GrantedAuthority)
        perm - id(Long), name(String) or Auth(GrantedAuthority)
        Returns:

        Whether to stop any subsequent Combo, default false.