ManagementEnforcer class
ManagementEnforcer = InternalEnforcer + Management API.
- Inheritance
-
- Object
- CoreEnforcer
- InternalEnforcer
- ManagementEnforcer
- Implementers
Constructors
Properties
- adapter ↔ Adapter
-
getter/setter pairinherited
- autoBuildRoleLinks ↔ bool
-
getter/setter pairinherited
- autoNotifyDispatcher ↔ bool
-
getter/setter pairinherited
- autoNotifyWatcher ↔ bool
-
getter/setter pairinherited
- autoSave ↔ bool
-
getter/setter pairinherited
- dispatcher ↔ Dispatcher?
-
getter/setter pairinherited
- eft ↔ Effector
-
getter/setter pairinherited
- fm ↔ FunctionMap
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger ↔ Logger
-
getter/setter pairinherited
- model ↔ Model
-
getter/setter pairinherited
- modelCount ↔ int
-
getter/setter pairinherited
- modelPath ↔ String
-
getter/setter pairinherited
- rm ↔ RoleManager
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- watcher ↔ Watcher?
-
getter/setter pairinherited
Methods
-
addFunction(
String name, Function function) → void -
addFunction adds a customized function.
name
the name of the new function.function
the function. -
addGroupingPolicy(
List< String> params) → bool - addGroupingPolicy adds a role inheritance rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule.
-
addNamedGroupingPolicy(
String ptype, List< String> params) → bool - addNamedGroupingPolicy adds a named role inheritance rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule.
-
addNamedPolicy(
String ptype, List< String> params) → bool - AddNamedPolicy adds an authorization rule to the current named policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule.
-
addPoliciesInternal(
String sec, String ptype, List< List< rules) → boolString> > -
addPolicies adds multiple rules to the current policy.
inherited
-
addPolicy(
List< String> params) → bool - addPolicy adds an authorization rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule.
-
addPolicyInternal(
String sec, String ptype, List< String> rule) → bool -
addPolicy adds a rule to the current policy.
inherited
-
addPolicyList(
List< String> params) → bool - addPolicy adds an authorization rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule.
-
buildIncrementalRoleLinks(
PolicyOperations op, String ptype, List< List< rules) → voidString> > -
buildIncrementalRoleLinks provides incremental build the role inheritance relations.
op
Policy operations.ptype
policy type.rules
the rules.inherited -
buildRoleLinks(
) → void -
Manually rebuild the role inheritance relations.
inherited
-
clearPolicy(
) → void -
Clears all policy.
inherited
-
enableAutoBuildRoleLinks(
bool autoBuildRoleLinks) → void -
Controls whether to save a policy rule automatically to the adapter when it is added or removed.
inherited
-
enableAutoSave(
bool autoSave) → void -
Controls whether to save a policy rule automatically to the adapter when it is added or removed.
inherited
-
enableEnforce(
bool enable) → void -
Changes the enforcing state of Casbin, when Casbin is disabled, all access will be allowed by the enforce() function.
inherited
-
enableLog(
bool enable) → void -
Changes whether to print Casbin log to the standard output.
inherited
-
enforce(
List rvals) → bool -
Returns whether a "subject" can access a "object" with the operation "action", input parameters are usually:
sub, obj, act
.inherited -
getAdapter(
) → Adapter -
Returns the current adapter.
inherited
-
getAllActions(
) → List< String> - getAllActions gets the list of actions that show up in the current policy.
-
getAllNamedActions(
String ptype) → List< String> - GetAllNamedActions gets the list of actions that show up in the current named policy.
-
getAllNamedObjects(
String ptype) → List< String> - getAllNamedObjects gets the list of objects that show up in the current named policy.
-
getAllNamedRoles(
String ptype) → List< String> - getAllNamedRoles gets the list of roles that show up in the current named policy.
-
getAllNamedSubjects(
String ptype) → List< String> - GetAllNamedSubjects gets the list of subjects that show up in the current named policy.
-
getAllObjects(
) → List< String> - getAllObjects gets the list of objects that show up in the current policy.
-
getAllRoles(
) → List< String> - getAllRoles gets the list of roles that show up in the current policy.
-
getAllSubjects(
) → List< String> - getAllSubjects gets the list of subjects that show up in the current policy.
-
getDomainIndex(
String ptype) → int -
inherited
-
getFilteredGroupingPolicy(
int fieldIndex, dynamic fieldValues) → List< List< String> > - getFilteredGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
-
getFilteredNamedGroupingPolicy(
String ptype, int fieldIndex, List< String> fieldValues) → List<List< String> > - getFilteredNamedGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
-
getFilteredNamedPolicy(
String ptype, int fieldIndex, List< String> fieldValues) → List<List< String> > - getFilteredNamedPolicy gets all the authorization rules in the named policy, field filters can be specified.
-
getFilteredPolicy(
int fieldIndex, List< String> fieldValues) → List<List< String> > - getFilteredPolicy gets all the authorization rules in the policy, field filters can be specified.
-
getGroupingPolicy(
) → List< List< String> > - getGroupingPolicy gets all the role inheritance rules in the policy.
-
getModel(
) → Model -
Returns the current model.
inherited
-
getNamedGroupingPolicy(
String ptype) → List< List< String> > - getNamedGroupingPolicy gets all the role inheritance rules in the policy.
-
getNamedPolicy(
String ptype) → List< List< String> > - getNamedPolicy gets all the authorization rules in the named policy.
-
getPermittedActions(
String sub, String obj) → Set< String> - getPermittedActions returns all valid actions to specific object for current subject. At present, the execution efficiency of this method is not high. Please avoid calling this method frequently.
-
getPolicy(
) → List< List< String> > - getPolicy gets all the authorization rules in the policy.
-
hasGroupingPolicy(
List< String> params) → bool -
hasGroupingPolicy determines whether a role inheritance rule exists.
params
the "g" policy rule, ptype "g" is implicitly used. return whether the rule exists. -
hasNamedGroupingPolicy(
String ptype, List< String> params) → bool -
hasNamedGroupingPolicy determines whether a named role inheritance rule exists.
ptype
the policy type, can be "g", "g2", "g3", ..params
the "g" policy rule. return whether the rule exists. -
hasNamedPolicy(
String ptype, List< String> params) → bool - hasNamedPolicy determines whether a named authorization rule exists.
-
hasPolicy(
List< String> params) → bool - hasPolicy determines whether an authorization rule exists.
-
isAutoNotifyDispatcher(
) → bool -
inherited
-
isAutoNotifyWatcher(
) → bool -
inherited
-
isFiltered(
) → bool -
Returns if the loaded policy has been filtered.
inherited
-
loadFilteredPolicy(
dynamic filter) → void -
Reloads a filtered policy from file/database.
inherited
-
loadModel(
) → void -
Reloads the model from the model CONF file.
Because the policy is attached to a model, so the policy is invalidated
and needs to be reloaded by calling loadPolicy().
inherited
-
loadPolicy(
) → void -
Reloads the policy from file/database.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFilteredGroupingPolicy(
int fieldIndex, List< String> fieldValues) → bool -
removeFilteredGroupingPolicy removes a role inheritance rule from the current policy, field filters can be specified.
fieldIndex
the policy rule's start index to be matched.fieldValues
the field values to be matched, value "" means not to match this field. return succeeds or not. -
removeFilteredNamedGroupingPolicy(
String ptype, int fieldIndex, List< String> fieldValues) → bool -
removeFilteredNamedGroupingPolicy removes a role inheritance rule from the current named policy, field filters can be specified.
ptype
the policy type, can be "g", "g2", "g3", ..fieldIndex
the policy rule's start index to be matched.fieldValues
the field values to be matched, value "" means not to match this field. return succeeds or not. -
removeFilteredNamedPolicy(
String ptype, int fieldIndex, List< String> fieldValues) → bool - removeFilteredNamedPolicy removes an authorization rule from the current named policy, field filters can be specified.
-
removeFilteredPolicy(
int fieldIndex, List< String> fieldValues) → bool - removeFilteredPolicy removes an authorization rule from the current policy, field filters can be specified.
-
removeFilteredPolicyInternal(
String sec, String ptype, int fieldIndex, List< String> fieldValues) → bool -
removeFilteredPolicyInternal removes rules based on field filters from the current policy.
inherited
-
removeGroupingPolicy(
List< String> params) → bool - removeGroupingPolicy removes a role inheritance rule from the current policy.
-
removeNamedGroupingPolicy(
String ptype, List< String> params) → bool - removeNamedGroupingPolicy removes a role inheritance rule from the current named policy.
-
removeNamedPolicy(
String ptype, List< String> params) → bool - removeNamedPolicy removes an authorization rule from the current named policy.
-
removePoliciesInternal(
String sec, String ptype, List< List< rules) → boolString> > -
removePoliciesInternal removes rules from the current policy.
inherited
-
removePolicy(
List< String> params) → bool - removePolicy removes an authorization rule from the current policy.
-
removePolicyInternal(
String sec, String ptype, List< String> rule) → bool -
removePolicy removes a rule from the current policy.
inherited
-
savePolicy(
) → void -
Saves the current policy (usually after changed with Casbin API) back to file/database.
inherited
-
setAdapter(
Adapter adapter) → void -
Sets the current adapter.
inherited
-
setAutoNotifyDispatcher(
bool autoNotifyDispatcher) → void -
inherited
-
setAutoNotifyWatcher(
bool autoNotifyWatcher) → void -
inherited
-
setDispatcher(
Dispatcher dispatcher) → void -
Sets the current dispatcher.
inherited
-
setEffector(
Effector eft) → void -
Sets the current effector.
inherited
-
setModel(
Model model) → void -
setModel sets the current model.
inherited
-
setRoleManager(
RoleManager rm) → void -
Sets the current role manager.
inherited
-
setWatcher(
Watcher watcher) → void -
Sets the current watcher.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateNamedPolicy(
String ptype, List< String> params1, List<String> params2) → bool - updateNamedPolicy updates an authorization rule to the current named policy.
-
updatePolicy(
List< String> params1, List<String> params2) → bool -
updatePolicy update an authorization rule to the current policy.
params1
the old rule.params2
the new rule. returns succeeds or not. -
updatePolicyInternal(
String sec, String ptype, List< String> oldRule, List<String> newRule) → bool -
updatePolicy updates an authorization rule from the current policy.
inherited
-
validateEnforce(
List< String> rvals) → bool -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited