Interface Dispatcher


  • public interface Dispatcher
    Dispatcher is the interface for jCasbin dispatcher
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addPolicies​(java.lang.String sec, java.lang.String ptype, java.util.List<java.util.List<java.lang.String>> rules)
      AddPolicies adds policies rule to all instance.
      void clearPolicy()
      ClearPolicy clears all current policy in all instances
      void removeFilteredPolicy​(java.lang.String sec, java.lang.String ptype, int fieldIndex, java.lang.String... fieldValues)
      RemoveFilteredPolicy removes policy rules that match the filter from all instance.
      void removePolicies​(java.lang.String sec, java.lang.String ptype, java.util.List<java.util.List<java.lang.String>> rules)
      RemovePolicies removes policies rule from all instance.
      void updatePolicy​(java.lang.String sec, java.lang.String ptype, java.util.List<java.lang.String> oldRule, java.util.List<java.lang.String> newRule)
      UpdatePolicy updates policy rule from all instance.
    • Method Detail

      • addPolicies

        void addPolicies​(java.lang.String sec,
                         java.lang.String ptype,
                         java.util.List<java.util.List<java.lang.String>> rules)
        AddPolicies adds policies rule to all instance.
        Parameters:
        sec - the section to which the policies belong, e.g., "p" or "g".
        ptype - the policy type, such as "p" for permissions or "g" for roles.
        rules - the list of policy rules to be added, where each rule is represented as a list of strings.
      • removePolicies

        void removePolicies​(java.lang.String sec,
                            java.lang.String ptype,
                            java.util.List<java.util.List<java.lang.String>> rules)
        RemovePolicies removes policies rule from all instance.
        Parameters:
        sec - the section from which to remove policies, e.g., "p" or "g".
        ptype - the policy type to remove, such as "p" or "g".
        rules - the list of policy rules to be removed, where each rule is represented as a list of strings.
      • removeFilteredPolicy

        void removeFilteredPolicy​(java.lang.String sec,
                                  java.lang.String ptype,
                                  int fieldIndex,
                                  java.lang.String... fieldValues)
        RemoveFilteredPolicy removes policy rules that match the filter from all instance.
        Parameters:
        sec - the section from which to remove policies, e.g., "p" or "g".
        ptype - the policy type to filter, such as "p" or "g".
        fieldIndex - the index of the field to filter on.
        fieldValues - the values to filter by for the specified field index.
      • clearPolicy

        void clearPolicy()
        ClearPolicy clears all current policy in all instances
      • updatePolicy

        void updatePolicy​(java.lang.String sec,
                          java.lang.String ptype,
                          java.util.List<java.lang.String> oldRule,
                          java.util.List<java.lang.String> newRule)
        UpdatePolicy updates policy rule from all instance.
        Parameters:
        sec - the section containing the policy, e.g., "p" or "g".
        ptype - the policy type to update, such as "p" or "g".
        oldRule - the existing policy rule to be updated, represented as a list of strings.
        newRule - the new policy rule that will replace the old one, represented as a list of strings.