Interface Dispatcher


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

    • addPolicies

      void addPolicies(String sec, String ptype, List<List<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(String sec, String ptype, List<List<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(String sec, String ptype, int fieldIndex, 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(String sec, String ptype, List<String> oldRule, List<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.