Package org.casbin.jcasbin.main
Class InternalEnforcer
java.lang.Object
org.casbin.jcasbin.main.CoreEnforcer
org.casbin.jcasbin.main.InternalEnforcer
- Direct Known Subclasses:
ManagementEnforcer
InternalEnforcer = CoreEnforcer + Internal API.
-
Field Summary
Fields inherited from class org.casbin.jcasbin.main.CoreEnforcer
acceptJsonRequest, adapter, autoBuildRoleLinks, autoNotifyDispatcher, autoNotifyWatcher, autoSave, condRmMap, dispatcher, fm, model, modelPath, rmMap, watcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
addPolicies adds rules to the current policy.(package private) boolean
addPolicy adds a rule to the current policy.private void
buildIncrementalRoleLinks
(String sec, String ptype, List<List<String>> rules, Model.PolicyOperations operation) void
buildIncrementalRoleLinks
(Model.PolicyOperations op, String ptype, List<List<String>> rules) buildIncrementalRoleLinks provides incremental build the role inheritance relations.(package private) int
getDomainIndex
(String ptype) private boolean
notifyWatcher
(String sec, String ptype, List<List<String>> rules, WatcherEx.UpdateType updateType) (package private) boolean
removeFilteredPolicy
(String sec, String ptype, int fieldIndex, String... fieldValues) removeFilteredPolicy removes rules based on field filters from the current policy.(package private) boolean
removePolicies removes rules from the current policy.(package private) boolean
removePolicy
(String sec, String ptype, List<String> rule) removePolicy removes a rule from the current policy.(package private) boolean
updatePolicy updates an authorization rule from the current policy.Methods inherited from class org.casbin.jcasbin.main.CoreEnforcer
addNamedDomainLinkConditionFunc, addNamedDomainMatchingFunc, addNamedLinkConditionFunc, addNamedMatchingFunc, buildConditionalRoleLinks, buildRoleLinks, clearPolicy, enableAcceptJsonRequest, enableAutoBuildRoleLinks, enableAutoSave, enableEnforce, enableLog, enforce, enforceEx, enforceExWithMatcher, enforceWithMatcher, getAdapter, getAviatorEval, getModel, getNamedRoleManager, getRmMap, getRoleManager, initialize, isAutoNotifyDispatcher, isAutoNotifyWatcher, isFiltered, loadFilteredPolicy, loadModel, loadPolicy, mustUseDispatcher, newModel, newModel, newModel, resetExpressionEvaluator, savePolicy, setAdapter, setAutoNotifyDispatcher, setAutoNotifyWatcher, setAviatorEvaluator, setDispatcher, setEffector, setModel, setNamedDomainLinkConditionFuncParams, setNamedLinkConditionFuncParams, setNamedRoleManager, setRoleManager, setRoleManager, setWatcher, validateEnforce
-
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 policiesupdateType
- the UpdateType- Returns:
- indicate whether the notification to the Watcher is successful or not
-
addPolicy
addPolicy adds a rule to the current policy. -
addPolicies
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
removePolicy removes a rule from the current policy. -
updatePolicy
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
removePolicies removes rules from the current policy. -
removeFilteredPolicy
removeFilteredPolicy removes rules based on field filters from the current policy. -
getDomainIndex
-
buildIncrementalRoleLinks
-