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 CoreEnforcer
acceptJsonRequest, adapter, autoBuildRoleLinks, autoNotifyDispatcher, autoNotifyWatcher, autoSave, condRmMap, dispatcher, fm, model, modelPath, rmMap, watcher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanaddPolicies adds rules to the current policy.(package private) booleanaddPolicy adds a rule to the current policy.private voidbuildIncrementalRoleLinks(String sec, String ptype, List<List<String>> rules, Model.PolicyOperations operation) voidbuildIncrementalRoleLinks(Model.PolicyOperations op, String ptype, List<List<String>> rules) buildIncrementalRoleLinks provides incremental build the role inheritance relations.(package private) intgetDomainIndex(String ptype) private booleannotifyWatcher(String sec, String ptype, List<List<String>> rules, WatcherEx.UpdateType updateType) (package private) booleanremoveFilteredPolicy(String sec, String ptype, int fieldIndex, String... fieldValues) removeFilteredPolicy removes rules based on field filters from the current policy.(package private) booleanremovePolicies removes rules from the current policy.(package private) booleanremovePolicy(String sec, String ptype, List<String> rule) removePolicy removes a rule from the current policy.(package private) booleanupdatePolicy updates an authorization rule from the current policy.Methods inherited from class 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
-
addPolicies
-
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
-
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
-
removeFilteredPolicy
-
getDomainIndex
-
buildIncrementalRoleLinks
-