public class ManagementEnforcer extends CoreEnforcer
| Constructor and Description |
|---|
ManagementEnforcer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFunction(java.lang.String name,
com.googlecode.aviator.runtime.type.AviatorFunction function)
addFunction adds a customized function.
|
boolean |
addGroupingPolicy(java.util.List<java.lang.String> params)
addGroupingPolicy adds a role inheritance rule to the current policy.
|
boolean |
addGroupingPolicy(java.lang.String... params)
addGroupingPolicy adds a role inheritance rule to the current policy.
|
boolean |
addNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
addNamedGroupingPolicy adds a named role inheritance rule to the current policy.
|
boolean |
addNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
addNamedGroupingPolicy adds a named role inheritance rule to the current policy.
|
boolean |
addNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
AddNamedPolicy adds an authorization rule to the current named policy.
|
boolean |
addNamedPolicy(java.lang.String ptype,
java.lang.String... params)
AddNamedPolicy adds an authorization rule to the current named policy.
|
boolean |
addPolicy(java.util.List<java.lang.String> params)
addPolicy adds an authorization rule to the current policy.
|
boolean |
addPolicy(java.lang.String... params)
addPolicy adds an authorization rule 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.
|
java.util.List<java.lang.String> |
getAllActions()
getAllActions gets the list of actions that show up in the current policy.
|
java.util.List<java.lang.String> |
getAllNamedActions(java.lang.String ptype)
GetAllNamedActions gets the list of actions that show up in the current named policy.
|
java.util.List<java.lang.String> |
getAllNamedObjects(java.lang.String ptype)
getAllNamedObjects gets the list of objects that show up in the current named policy.
|
java.util.List<java.lang.String> |
getAllNamedRoles(java.lang.String ptype)
getAllNamedRoles gets the list of roles that show up in the current named policy.
|
java.util.List<java.lang.String> |
getAllNamedSubjects(java.lang.String ptype)
GetAllNamedSubjects gets the list of subjects that show up in the currentnamed policy.
|
java.util.List<java.lang.String> |
getAllObjects()
getAllObjects gets the list of objects that show up in the current policy.
|
java.util.List<java.lang.String> |
getAllRoles()
getAllRoles gets the list of roles that show up in the current policy.
|
java.util.List<java.lang.String> |
getAllSubjects()
getAllSubjects gets the list of subjects that show up in the current policy.
|
java.util.List<java.util.List<java.lang.String>> |
getFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
getFilteredGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
|
java.util.List<java.util.List<java.lang.String>> |
getFilteredNamedGroupingPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
getFilteredNamedGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
|
java.util.List<java.util.List<java.lang.String>> |
getFilteredNamedPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
getFilteredNamedPolicy gets all the authorization rules in the named policy, field filters can be specified.
|
java.util.List<java.util.List<java.lang.String>> |
getFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
getFilteredPolicy gets all the authorization rules in the policy, field filters can be specified.
|
java.util.List<java.util.List<java.lang.String>> |
getGroupingPolicy()
getGroupingPolicy gets all the role inheritance rules in the policy.
|
java.util.List<java.util.List<java.lang.String>> |
getNamedGroupingPolicy(java.lang.String ptype)
getNamedGroupingPolicy gets all the role inheritance rules in the policy.
|
java.util.List<java.util.List<java.lang.String>> |
getNamedPolicy(java.lang.String ptype)
getNamedPolicy gets all the authorization rules in the named policy.
|
java.util.Set<java.lang.String> |
getPermittedActions(java.lang.Object sub,
java.lang.Object obj)
getPermittedActions returns all valid actions to specific object for current subject.
|
java.util.List<java.util.List<java.lang.String>> |
getPolicy()
getPolicy gets all the authorization rules in the policy.
|
boolean |
hasGroupingPolicy(java.util.List<java.lang.String> params)
hasGroupingPolicy determines whether a role inheritance rule exists.
|
boolean |
hasGroupingPolicy(java.lang.String... params)
hasGroupingPolicy determines whether a role inheritance rule exists.
|
boolean |
hasNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
hasNamedGroupingPolicy determines whether a named role inheritance rule exists.
|
boolean |
hasNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
hasNamedGroupingPolicy determines whether a named role inheritance rule exists.
|
boolean |
hasNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
hasNamedPolicy determines whether a named authorization rule exists.
|
boolean |
hasNamedPolicy(java.lang.String ptype,
java.lang.String... params)
hasNamedPolicy determines whether a named authorization rule exists.
|
boolean |
hasPolicy(java.util.List<java.lang.String> params)
hasPolicy determines whether an authorization rule exists.
|
boolean |
hasPolicy(java.lang.String... params)
hasPolicy determines whether an authorization rule exists.
|
boolean |
removeFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
removeFilteredGroupingPolicy removes a role inheritance rule from the current policy, field filters can be specified.
|
boolean |
removeFilteredNamedGroupingPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
removeFilteredNamedGroupingPolicy removes a role inheritance rule from the current named policy, field filters can be specified.
|
boolean |
removeFilteredNamedPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
removeFilteredNamedPolicy removes an authorization rule from the current named policy, field filters can be specified.
|
boolean |
removeFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
removeFilteredPolicy removes an authorization rule from the current policy, field filters can be specified.
|
boolean |
removeGroupingPolicy(java.util.List<java.lang.String> params)
removeGroupingPolicy removes a role inheritance rule from the current policy.
|
boolean |
removeGroupingPolicy(java.lang.String... params)
removeGroupingPolicy removes a role inheritance rule from the current policy.
|
boolean |
removeNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
removeNamedGroupingPolicy removes a role inheritance rule from the current named policy.
|
boolean |
removeNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
removeNamedGroupingPolicy removes a role inheritance rule from the current named policy.
|
boolean |
removeNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
removeNamedPolicy removes an authorization rule from the current named policy.
|
boolean |
removeNamedPolicy(java.lang.String ptype,
java.lang.String... params)
removeNamedPolicy removes an authorization rule from the current named policy.
|
boolean |
removePolicy(java.util.List<java.lang.String> params)
removePolicy removes an authorization rule from the current policy.
|
boolean |
removePolicy(java.lang.String... params)
removePolicy removes an authorization rule from the current policy.
|
boolean |
updateNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updateNamedPolicy updates an authorization rule to the current named policy.
|
boolean |
updatePolicy(java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updatePolicy update an authorization rule to the current policy.
|
buildRoleLinks, clearPolicy, enableAutoBuildRoleLinks, enableAutoSave, enableEnforce, enableLog, enforce, getAdapter, getModel, isAutoNotifyDispatcher, isAutoNotifyWatcher, isFiltered, loadFilteredPolicy, loadModel, loadPolicy, newModel, newModel, newModel, resetExpressionEvaluator, savePolicy, setAdapter, setAutoNotifyDispatcher, setAutoNotifyWatcher, setDispatcher, setEffector, setModel, setRoleManager, setWatcher, validateEnforcepublic java.util.List<java.lang.String> getAllSubjects()
public java.util.List<java.lang.String> getAllNamedSubjects(java.lang.String ptype)
ptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllObjects()
public java.util.List<java.lang.String> getAllNamedObjects(java.lang.String ptype)
ptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllActions()
public java.util.List<java.lang.String> getAllNamedActions(java.lang.String ptype)
ptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllRoles()
public java.util.List<java.lang.String> getAllNamedRoles(java.lang.String ptype)
ptype - the policy type, can be "g", "g2", "g3", ..public java.util.List<java.util.List<java.lang.String>> getPolicy()
public java.util.List<java.util.List<java.lang.String>> getFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
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 java.util.List<java.util.List<java.lang.String>> getNamedPolicy(java.lang.String ptype)
ptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.util.List<java.lang.String>> getFilteredNamedPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
ptype - the policy type, can be "p", "p2", "p3", ..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 java.util.List<java.util.List<java.lang.String>> getGroupingPolicy()
public java.util.List<java.util.List<java.lang.String>> getFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
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 java.util.List<java.util.List<java.lang.String>> getNamedGroupingPolicy(java.lang.String ptype)
ptype - the policy type, can be "g", "g2", "g3", ..public java.util.List<java.util.List<java.lang.String>> getFilteredNamedGroupingPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
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.public boolean hasPolicy(java.util.List<java.lang.String> params)
params - the "p" policy rule, ptype "p" is implicitly used.public boolean hasPolicy(java.lang.String... params)
params - the "p" policy rule, ptype "p" is implicitly used.public boolean hasNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
ptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean hasNamedPolicy(java.lang.String ptype,
java.lang.String... params)
ptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean addPolicy(java.util.List<java.lang.String> params)
params - the "p" policy rule, ptype "p" is implicitly used.public boolean updatePolicy(java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
params1 - the old rule.params2 - the new rule.public boolean addPolicy(java.lang.String... params)
params - the "p" policy rule, ptype "p" is implicitly used.public boolean addNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
ptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean updateNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
ptype - the policy type, can be "p", "p2", "p3", ..params1 - the old rule.params2 - the new rule.public boolean addNamedPolicy(java.lang.String ptype,
java.lang.String... params)
ptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean removePolicy(java.util.List<java.lang.String> params)
params - the "p" policy rule, ptype "p" is implicitly used.public boolean removePolicy(java.lang.String... params)
params - the "p" policy rule, ptype "p" is implicitly used.public boolean removeFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
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 boolean removeNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
ptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean removeNamedPolicy(java.lang.String ptype,
java.lang.String... params)
ptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean removeFilteredNamedPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
ptype - the policy type, can be "p", "p2", "p3", ..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 boolean hasGroupingPolicy(java.util.List<java.lang.String> params)
params - the "g" policy rule, ptype "g" is implicitly used.public boolean hasGroupingPolicy(java.lang.String... params)
params - the "g" policy rule, ptype "g" is implicitly used.public boolean hasNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
ptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean hasNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
ptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean addGroupingPolicy(java.util.List<java.lang.String> params)
params - the "g" policy rule, ptype "g" is implicitly used.public boolean addGroupingPolicy(java.lang.String... params)
params - the "g" policy rule, ptype "g" is implicitly used.public boolean addNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
ptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean addNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
ptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean removeGroupingPolicy(java.util.List<java.lang.String> params)
params - the "g" policy rule, ptype "g" is implicitly used.public boolean removeGroupingPolicy(java.lang.String... params)
params - the "g" policy rule, ptype "g" is implicitly used.public boolean removeFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
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 boolean removeNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
ptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean removeNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
ptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean removeFilteredNamedGroupingPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
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.public void addFunction(java.lang.String name,
com.googlecode.aviator.runtime.type.AviatorFunction function)
name - the name of the new function.function - the function.public java.util.Set<java.lang.String> getPermittedActions(java.lang.Object sub,
java.lang.Object obj)
sub - the subject(usually means user).obj - the object(usually means resources).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.