Class InternalEnforcer

java.lang.Object
org.casbin.jcasbin.main.CoreEnforcer
org.casbin.jcasbin.main.InternalEnforcer
Direct Known Subclasses:
ManagementEnforcer

class InternalEnforcer extends CoreEnforcer
InternalEnforcer = CoreEnforcer + Internal API.
  • Constructor Details

    • InternalEnforcer

      InternalEnforcer()
  • Method Details

    • notifyWatcher

      private boolean notifyWatcher(String sec, String ptype, List<List<String>> rules, WatcherEx.UpdateType updateType)
      Parameters:
      sec - the section, "p" or "g".
      ptype - the policy type, "p", "p2", .. or "g", "g2", ..
      rules - the policies
      updateType - the UpdateType
      Returns:
      indicate whether the notification to the Watcher is successful or not
    • addPolicy

      boolean addPolicy(String sec, String ptype, List<String> rule)
      addPolicy adds a rule to the current policy.
    • addPolicies

      boolean addPolicies(String sec, String ptype, List<List<String>> rules, boolean autoRemoveRepeat)
      addPolicies adds rules to the current policy.
    • buildIncrementalRoleLinks

      public void buildIncrementalRoleLinks(Model.PolicyOperations op, String ptype, List<List<String>> rules)
      buildIncrementalRoleLinks provides incremental build the role inheritance relations.
      Parameters:
      op - Policy operations.
      ptype - policy type.
      rules - the rules.
    • removePolicy

      boolean removePolicy(String sec, String ptype, List<String> rule)
      removePolicy removes a rule from the current policy.
    • updatePolicy

      boolean updatePolicy(String sec, String ptype, List<String> oldRule, List<String> newRule)
      updatePolicy updates an authorization rule from the current policy.
      Parameters:
      sec - the section, "p" or "g".
      ptype - the policy type, "p", "p2", .. or "g", "g2", ..
      oldRule - the old rule.
      newRule - the new rule.
      Returns:
      succeeds or not.
    • removePolicies

      boolean removePolicies(String sec, String ptype, List<List<String>> rules)
      removePolicies removes rules from the current policy.
    • removeFilteredPolicy

      boolean removeFilteredPolicy(String sec, String ptype, int fieldIndex, String... fieldValues)
      removeFilteredPolicy removes rules based on field filters from the current policy.
    • getDomainIndex

      int getDomainIndex(String ptype)
    • buildIncrementalRoleLinks

      private void buildIncrementalRoleLinks(String sec, String ptype, List<List<String>> rules, Model.PolicyOperations operation)