Package org.casbin.jcasbin.persist
Interface Dispatcher
public interface Dispatcher
Dispatcher is the interface for jCasbin dispatcher
-
Method Summary
Modifier and TypeMethodDescriptionvoid
AddPolicies adds policies rule to all instance.void
ClearPolicy clears all current policy in all instancesvoid
removeFilteredPolicy
(String sec, String ptype, int fieldIndex, String... fieldValues) RemoveFilteredPolicy removes policy rules that match the filter from all instance.void
RemovePolicies removes policies rule from all instance.void
UpdatePolicy updates policy rule from all instance.
-
Method Details
-
addPolicies
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
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
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
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.
-