public class DistributedEnforcer extends SyncedEnforcer
| Constructor and Description |
|---|
DistributedEnforcer()
DistributedEnforcer is the default constructor.
|
DistributedEnforcer(Model m)
DistributedEnforcer initializes an enforcer with a model.
|
DistributedEnforcer(Model m,
Adapter adapter)
DistributedEnforcer initializes an enforcer with a model and a database adapter.
|
DistributedEnforcer(java.lang.String modelPath)
DistributedEnforcer initializes an enforcer with a model file.
|
DistributedEnforcer(java.lang.String modelPath,
Adapter adapter)
DistributedEnforcer initializes an enforcer with a database adapter.
|
DistributedEnforcer(java.lang.String modelPath,
java.lang.String policyFile)
DistributedEnforcer initializes an enforcer with a model file and a policy file.
|
DistributedEnforcer(java.lang.String modelPath,
java.lang.String policyFile,
boolean enableLog)
DistributedEnforcer initializes an enforcer with a model file, a policy file and an enable log flag.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.util.List<java.lang.String>> |
addPolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
AddPolicySelf provides a method for dispatcher to add authorization rules to the current policy.
|
void |
buildIncrementalRoleLinks(Model.PolicyOperations op,
java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
buildIncrementalRoleLinks provides incremental build the role inheritance relations.
|
void |
clearPolicySelf(java.util.function.BooleanSupplier shouldPersist)
ClearPolicySelf provides a method for dispatcher to clear all rules from the current policy.
|
java.util.List<java.util.List<java.lang.String>> |
removeFilteredPolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
RemoveFilteredPolicySelf provides a method for dispatcher to remove an authorization rule from the current policy,
field filters can be specified.
|
java.util.List<java.util.List<java.lang.String>> |
removePolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
RemovePolicySelf provides a method for dispatcher to remove policies from current policy.
|
boolean |
updatePolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
java.util.List<java.lang.String> oldRule,
java.util.List<java.lang.String> newRule)
UpdatePolicySelf provides a method for dispatcher to update an authorization rule from the current policy.
|
addGroupingPolicy, addGroupingPolicy, addNamedGroupingPolicy, addNamedGroupingPolicy, addNamedPolicy, addNamedPolicy, addPermissionForUser, addPermissionForUser, addPolicy, addPolicy, addRoleForUser, addRoleForUserInDomain, buildRoleLinks, clearPolicy, deletePermission, deletePermission, deletePermissionForUser, deletePermissionForUser, deletePermissionsForUser, deleteRole, deleteRoleForUser, deleteRoleForUserInDomain, deleteRolesForUser, deleteUser, enforce, getAllActions, getAllNamedActions, getAllNamedObjects, getAllNamedRoles, getAllObjects, getAllRoles, getAllSubjects, getFilteredGroupingPolicy, getFilteredNamedGroupingPolicy, getFilteredNamedPolicy, getFilteredPolicy, getGroupingPolicy, getImplicitPermissionsForUser, getImplicitRolesForUser, getNamedGroupingPolicy, getNamedPolicy, getPermissionsForUser, getPermissionsForUserInDomain, getPolicy, getRolesForUser, getRolesForUserInDomain, getUsersForRole, hasGroupingPolicy, hasGroupingPolicy, hasNamedGroupingPolicy, hasNamedGroupingPolicy, hasNamedPolicy, hasNamedPolicy, hasPermissionForUser, hasPermissionForUser, hasPolicy, hasPolicy, hasRoleForUser, loadFilteredPolicy, loadPolicy, removeFilteredGroupingPolicy, removeFilteredNamedGroupingPolicy, removeFilteredNamedPolicy, removeFilteredPolicy, removeGroupingPolicy, removeGroupingPolicy, removeNamedGroupingPolicy, removeNamedGroupingPolicy, removeNamedPolicy, removeNamedPolicy, removePolicy, removePolicy, savePolicy, setWatchergetImplicitPermissionsForUserInDomain, updatePermissionForUseraddFunction, getAllNamedSubjects, getPermittedActions, updateNamedPolicy, updatePolicyenableAutoBuildRoleLinks, enableAutoSave, enableEnforce, enableLog, getAdapter, getModel, isAutoNotifyDispatcher, isAutoNotifyWatcher, isFiltered, loadModel, newModel, newModel, newModel, resetExpressionEvaluator, setAdapter, setAutoNotifyDispatcher, setAutoNotifyWatcher, setDispatcher, setEffector, setModel, setRoleManager, validateEnforcepublic DistributedEnforcer()
public DistributedEnforcer(java.lang.String modelPath,
java.lang.String policyFile)
modelPath - the path of the model file.policyFile - the path of the policy file.public DistributedEnforcer(java.lang.String modelPath,
Adapter adapter)
modelPath - the path of the model file.adapter - the adapter.public DistributedEnforcer(Model m, Adapter adapter)
m - the model.adapter - the adapter.public DistributedEnforcer(Model m)
m - the model.public DistributedEnforcer(java.lang.String modelPath)
modelPath - the path of the model file.public DistributedEnforcer(java.lang.String modelPath,
java.lang.String policyFile,
boolean enableLog)
modelPath - the path of the model file.policyFile - the path of the policy file.enableLog - whether to enable Casbin's log.public java.util.List<java.util.List<java.lang.String>> addPolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
shouldPersist - sec - the section, "p" or "g".ptype - the policy type, "p", "p2", .. or "g", "g2", ..rules - the rules.public java.util.List<java.util.List<java.lang.String>> removePolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
shouldPersist - sec - the section, "p" or "g".ptype - the policy type, "p", "p2", .. or "g", "g2", ..rules - the rules.public java.util.List<java.util.List<java.lang.String>> removeFilteredPolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
shouldPersist - sec - the section, "p" or "g".ptype - the policy type, "p", "p2", .. or "g", "g2", ..fieldIndex - the policy rule's start index to be matched.fieldValues - the field values to be matched, value ""
means not to match this field.public void clearPolicySelf(java.util.function.BooleanSupplier shouldPersist)
shouldPersist - public boolean updatePolicySelf(java.util.function.BooleanSupplier shouldPersist,
java.lang.String sec,
java.lang.String ptype,
java.util.List<java.lang.String> oldRule,
java.util.List<java.lang.String> newRule)
shouldPersist - sec - the section, "p" or "g".ptype - the policy type, "p", "p2", .. or "g", "g2", ..oldRule - the old rule.newRule - the new rule.public void buildIncrementalRoleLinks(Model.PolicyOperations op, java.lang.String ptype, java.util.List<java.util.List<java.lang.String>> rules)
op - Policy operations.ptype - policy type.rules - the rules.Copyright © 2017–2021. All rights reserved.