Class RighterContext

  • All Implemented Interfaces:

    
    public class RighterContext
    
                        
    In the Controller layer through the interceptor to prevent data privilege elevation.
    The principle is who create and who destroy, audit data will respond in the form of header.
    When requesting edits, set allow, and when submitting changes, check and audit.
    
    Since:

    2021-03-27

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      RighterContext()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static void setAllow(Object obj) Set the `allow` items.
      static void funAllow(Consumer<Object> fun) Set the `allow` items.
      static void delAllow() Delete the `allow` items.
      static <R> R getAudit(boolean nonnull) Get the `audit` items.
      static void setAudit(Object json) Get the `audit` items.
      static void delAudit() Delete the `audit` items.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RighterContext

        RighterContext()
    • Method Detail

      • setAllow

         static void setAllow(Object obj)

        Set the `allow` items. Used in the controller, before response

      • delAllow

         static void delAllow()

        Delete the `allow` items. Used in the interceptor.

      • getAudit

        @Contract(value = "true ->!null") static <R> R getAudit(boolean nonnull)

        Get the `audit` items. Used in the controller, before business

      • setAudit

         static void setAudit(Object json)

        Get the `audit` items. Used in the interceptor.

      • delAudit

         static void delAudit()

        Delete the `audit` items. Used in the interceptor.