public class SyncedEnforcer extends Enforcer
| 构造器和说明 |
|---|
SyncedEnforcer()
;
SyncedEnforcer is the default constructor.
|
SyncedEnforcer(Model m)
SyncedEnforcer initializes an enforcer with a model.
|
SyncedEnforcer(Model m,
Adapter adapter)
SyncedEnforcer initializes an enforcer with a model and a database adapter.
|
SyncedEnforcer(java.lang.String modelPath)
SyncedEnforcer initializes an enforcer with a model file.
|
SyncedEnforcer(java.lang.String modelPath,
Adapter adapter)
SyncedEnforcer initializes an enforcer with a database adapter.
|
SyncedEnforcer(java.lang.String modelPath,
java.lang.String policyFile)
SyncedEnforcer initializes an enforcer with a model file and a policy file.
|
SyncedEnforcer(java.lang.String modelPath,
java.lang.String policyFile,
boolean enableLog)
SyncedEnforcer initializes an enforcer with a model file, a policy file and an enable log flag.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 |
addPermissionForUser(java.lang.String user,
java.util.List<java.lang.String> permission)
addPermissionForUser adds a permission for a user or role.
|
boolean |
addPermissionForUser(java.lang.String user,
java.lang.String... permission)
addPermissionForUser adds a permission for a user or role.
|
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.
|
boolean |
addRoleForUser(java.lang.String user,
java.lang.String role)
addRoleForUser adds a role for a user.
|
boolean |
addRoleForUserInDomain(java.lang.String user,
java.lang.String role,
java.lang.String domain)
addRoleForUserInDomain adds a role for a user inside a domain.
|
java.util.List<java.lang.Boolean> |
batchEnforce(java.util.List<java.util.List<java.lang.String>> rules)
batchEnforce enforce in batches
|
java.util.List<java.lang.Boolean> |
batchEnforceWithMatcher(java.lang.String matcher,
java.util.List<java.util.List<java.lang.String>> rules)
batchEnforceWithMatcher enforce with matcher in batches
|
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 |
buildRoleLinks()
buildRoleLinks manually rebuild the
role inheritance relations.
|
void |
clearPolicy()
clearPolicy clears all policy.
|
boolean |
deletePermission(java.util.List<java.lang.String> permission)
deletePermission deletes a permission.
|
boolean |
deletePermission(java.lang.String... permission)
deletePermission deletes a permission.
|
boolean |
deletePermissionForUser(java.lang.String user,
java.util.List<java.lang.String> permission)
deletePermissionForUser deletes a permission for a user or role.
|
boolean |
deletePermissionForUser(java.lang.String user,
java.lang.String... permission)
deletePermissionForUser deletes a permission for a user or role.
|
boolean |
deletePermissionsForUser(java.lang.String user)
deletePermissionsForUser deletes permissions for a user or role.
|
void |
deleteRole(java.lang.String role)
deleteRole deletes a role.
|
boolean |
deleteRoleForUser(java.lang.String user,
java.lang.String role)
deleteRoleForUser deletes a role for a user.
|
boolean |
deleteRoleForUserInDomain(java.lang.String user,
java.lang.String role,
java.lang.String domain)
deleteRoleForUserInDomain deletes a role for a user inside a domain.
|
boolean |
deleteRolesForUser(java.lang.String user)
deleteRolesForUser deletes all roles for a user.
|
boolean |
deleteUser(java.lang.String user)
deleteUser deletes a user.
|
boolean |
enforce(java.lang.Object... rvals)
enforce decides whether a "subject" can access a "object" with
the operation "action", input parameters are usually: (sub, obj, act).
|
boolean |
enforceWithMatcher(java.lang.String matcher,
java.lang.Object... rvals)
enforceWithMatcher use a custom matcher to decide whether a "subject" can access a "object" with the operation "action",
input parameters are usually: (matcher, sub, obj, act), use model matcher by default when matcher is "" or null.
|
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> |
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>> |
getImplicitPermissionsForUser(java.lang.String user,
java.lang.String... domain)
getImplicitPermissionsForUser gets implicit permissions for a user or role.
|
java.util.List<java.lang.String> |
getImplicitRolesForUser(java.lang.String name,
java.lang.String... domain)
getImplicitRolesForUser gets implicit roles that a user has.
|
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.List<java.util.List<java.lang.String>> |
getPermissionsForUser(java.lang.String user,
java.lang.String... domain)
getPermissionsForUser gets permissions for a user or role.
|
java.util.List<java.util.List<java.lang.String>> |
getPermissionsForUserInDomain(java.lang.String user,
java.lang.String domain)
getPermissionsForUserInDomain gets permissions for a user or role inside a domain.
|
java.util.List<java.util.List<java.lang.String>> |
getPolicy()
getPolicy gets all the authorization rules in the policy.
|
java.util.List<java.lang.String> |
getRolesForUser(java.lang.String name)
getRolesForUser gets the roles that a user has.
|
java.util.List<java.lang.String> |
getRolesForUserInDomain(java.lang.String name,
java.lang.String domain)
getRolesForUserInDomain gets the roles that a user has inside a domain.
|
java.util.List<java.lang.String> |
getUsersForRole(java.lang.String name)
getUsersForRole gets the users that has a role.
|
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 |
hasPermissionForUser(java.lang.String user,
java.util.List<java.lang.String> permission)
hasPermissionForUser determines whether a user has a permission.
|
boolean |
hasPermissionForUser(java.lang.String user,
java.lang.String... permission)
hasPermissionForUser determines whether a user has a permission.
|
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 |
hasRoleForUser(java.lang.String name,
java.lang.String role)
hasRoleForUser determines whether a user has a role.
|
void |
loadFilteredPolicy(java.lang.Object filter)
loadFilteredPolicy reloads a filtered policy from file/database.
|
void |
loadPolicy()
loadPolicy reloads the policy from file/database.
|
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.
|
void |
savePolicy()
savePolicy saves the current policy (usually after changed with
Casbin API) back to file/database.
|
void |
setWatcher(Watcher watcher)
setWatcher sets the current watcher.
|
getImplicitPermissionsForUserInDomain, getImplicitUsersForRole, updatePermissionForUseraddFunction, addGroupingPolicies, addGroupingPolicies, addNamedGroupingPolicies, addNamedGroupingPolicies, addNamedPolicies, addPolicies, addPolicies, getAllNamedSubjects, getPermittedActions, removeGroupingPolicies, removeGroupingPolicies, removeNamedGroupingPolicies, removeNamedGroupingPolicies, removeNamedPolicies, removePolicies, removePolicies, updateGroupingPolicy, updateNamedGroupingPolicy, updateNamedPolicy, updatePolicyenableAutoBuildRoleLinks, enableAutoSave, enableEnforce, enableLog, getAdapter, getModel, getRmMap, isAutoNotifyDispatcher, isAutoNotifyWatcher, isFiltered, loadModel, newModel, newModel, newModel, resetExpressionEvaluator, setAdapter, setAutoNotifyDispatcher, setAutoNotifyWatcher, setDispatcher, setEffector, setModel, setRoleManager, setRoleManager, validateEnforcepublic SyncedEnforcer()
public SyncedEnforcer(java.lang.String modelPath,
java.lang.String policyFile)
modelPath - the path of the model file.policyFile - the path of the policy file.public SyncedEnforcer(java.lang.String modelPath,
Adapter adapter)
modelPath - the path of the model file.adapter - the adapter.public SyncedEnforcer(Model m, Adapter adapter)
m - the model.adapter - the adapter.public SyncedEnforcer(Model m)
m - the model.public SyncedEnforcer(java.lang.String modelPath)
modelPath - the path of the model file.public SyncedEnforcer(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 void setWatcher(Watcher watcher)
setWatcher 在类中 CoreEnforcerwatcher - the watcher.public void clearPolicy()
clearPolicy 在类中 CoreEnforcerpublic void loadPolicy()
loadPolicy 在类中 CoreEnforcerpublic void loadFilteredPolicy(java.lang.Object filter)
loadFilteredPolicy 在类中 CoreEnforcerfilter - the filter used to specify which type of policy should be loaded.public void savePolicy()
savePolicy 在类中 CoreEnforcerpublic void buildRoleLinks()
buildRoleLinks 在类中 CoreEnforcerpublic boolean enforce(java.lang.Object... rvals)
enforce 在类中 CoreEnforcerrvals - the request needs to be mediated, usually an array
of strings, can be class instances if ABAC is used.public boolean enforceWithMatcher(java.lang.String matcher,
java.lang.Object... rvals)
enforceWithMatcher 在类中 CoreEnforcermatcher - the custom matcher.rvals - the request needs to be mediated, usually an array
of strings, can be class instances if ABAC is used.public java.util.List<java.lang.Boolean> batchEnforce(java.util.List<java.util.List<java.lang.String>> rules)
batchEnforce 在类中 Enforcerrules - the rules.public java.util.List<java.lang.Boolean> batchEnforceWithMatcher(java.lang.String matcher,
java.util.List<java.util.List<java.lang.String>> rules)
batchEnforceWithMatcher 在类中 Enforcermatcher - the custom matcher.rules - the rules.public java.util.List<java.lang.String> getAllSubjects()
getAllSubjects 在类中 ManagementEnforcerpublic java.util.List<java.lang.String> getAllObjects()
getAllObjects 在类中 ManagementEnforcerpublic java.util.List<java.lang.String> getAllNamedObjects(java.lang.String ptype)
getAllNamedObjects 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllActions()
getAllActions 在类中 ManagementEnforcerpublic java.util.List<java.lang.String> getAllNamedActions(java.lang.String ptype)
getAllNamedActions 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllRoles()
getAllRoles 在类中 ManagementEnforcerpublic java.util.List<java.lang.String> getAllNamedRoles(java.lang.String ptype)
getAllNamedRoles 在类中 ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..public java.util.List<java.util.List<java.lang.String>> getPolicy()
getPolicy 在类中 ManagementEnforcerpublic java.util.List<java.util.List<java.lang.String>> getFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
getFilteredPolicy 在类中 ManagementEnforcerfieldIndex - 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)
getNamedPolicy 在类中 ManagementEnforcerptype - 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)
getFilteredNamedPolicy 在类中 ManagementEnforcerptype - 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()
getGroupingPolicy 在类中 ManagementEnforcerpublic java.util.List<java.lang.String> getRolesForUser(java.lang.String name)
getRolesForUser 在类中 Enforcername - the user.public java.util.List<java.util.List<java.lang.String>> getFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
getFilteredGroupingPolicy 在类中 ManagementEnforcerfieldIndex - 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)
getNamedGroupingPolicy 在类中 ManagementEnforcerptype - 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)
getFilteredNamedGroupingPolicy 在类中 ManagementEnforcerptype - 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)
hasPolicy 在类中 ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean hasPolicy(java.lang.String... params)
hasPolicy 在类中 ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean hasNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
hasNamedPolicy 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean hasNamedPolicy(java.lang.String ptype,
java.lang.String... params)
hasNamedPolicy 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean addPolicy(java.util.List<java.lang.String> params)
addPolicy 在类中 ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean addPolicy(java.lang.String... params)
addPolicy 在类中 ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean addNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
addNamedPolicy 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean addNamedPolicy(java.lang.String ptype,
java.lang.String... params)
addNamedPolicy 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean removePolicy(java.util.List<java.lang.String> params)
removePolicy 在类中 ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean removePolicy(java.lang.String... params)
removePolicy 在类中 ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean removeFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
removeFilteredPolicy 在类中 ManagementEnforcerfieldIndex - 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)
removeNamedPolicy 在类中 ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean removeNamedPolicy(java.lang.String ptype,
java.lang.String... params)
removeNamedPolicy 在类中 ManagementEnforcerptype - 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)
removeFilteredNamedPolicy 在类中 ManagementEnforcerptype - 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)
hasGroupingPolicy 在类中 ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean hasGroupingPolicy(java.lang.String... params)
hasGroupingPolicy 在类中 ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean hasNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
hasNamedGroupingPolicy 在类中 ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean hasNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
hasNamedGroupingPolicy 在类中 ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean addGroupingPolicy(java.util.List<java.lang.String> params)
addGroupingPolicy 在类中 ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean addGroupingPolicy(java.lang.String... params)
addGroupingPolicy 在类中 ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean addNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
addNamedGroupingPolicy 在类中 ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean addNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
addNamedGroupingPolicy 在类中 ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean removeGroupingPolicy(java.util.List<java.lang.String> params)
removeGroupingPolicy 在类中 ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean removeGroupingPolicy(java.lang.String... params)
removeGroupingPolicy 在类中 ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean removeFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
removeFilteredGroupingPolicy 在类中 ManagementEnforcerfieldIndex - 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)
removeNamedGroupingPolicy 在类中 ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean removeNamedGroupingPolicy(java.lang.String ptype,
java.lang.String... params)
removeNamedGroupingPolicy 在类中 ManagementEnforcerptype - 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)
removeFilteredNamedGroupingPolicy 在类中 ManagementEnforcerptype - 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 java.util.List<java.lang.String> getUsersForRole(java.lang.String name)
getUsersForRole 在类中 Enforcername - the role.public boolean hasRoleForUser(java.lang.String name,
java.lang.String role)
hasRoleForUser 在类中 Enforcername - the user.role - the role.public boolean addRoleForUser(java.lang.String user,
java.lang.String role)
addRoleForUser 在类中 Enforceruser - the user.role - the role.public boolean deleteRoleForUser(java.lang.String user,
java.lang.String role)
deleteRoleForUser 在类中 Enforceruser - the user.role - the role.public boolean deleteRolesForUser(java.lang.String user)
deleteRolesForUser 在类中 Enforceruser - the user.public boolean deleteUser(java.lang.String user)
deleteUser 在类中 Enforceruser - the user.public void deleteRole(java.lang.String role)
deleteRole 在类中 Enforcerrole - the role.public boolean deletePermission(java.lang.String... permission)
deletePermission 在类中 Enforcerpermission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean deletePermission(java.util.List<java.lang.String> permission)
deletePermission 在类中 Enforcerpermission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean addPermissionForUser(java.lang.String user,
java.lang.String... permission)
addPermissionForUser 在类中 Enforceruser - the user.permission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean addPermissionForUser(java.lang.String user,
java.util.List<java.lang.String> permission)
addPermissionForUser 在类中 Enforceruser - the user.permission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean deletePermissionForUser(java.lang.String user,
java.lang.String... permission)
deletePermissionForUser 在类中 Enforceruser - the user.permission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean deletePermissionForUser(java.lang.String user,
java.util.List<java.lang.String> permission)
deletePermissionForUser 在类中 Enforceruser - the user.permission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean deletePermissionsForUser(java.lang.String user)
deletePermissionsForUser 在类中 Enforceruser - the user.public java.util.List<java.util.List<java.lang.String>> getPermissionsForUser(java.lang.String user,
java.lang.String... domain)
getPermissionsForUser 在类中 Enforceruser - the user.domain - the user's domain.public boolean hasPermissionForUser(java.lang.String user,
java.lang.String... permission)
hasPermissionForUser 在类中 Enforceruser - the user.permission - the permission, usually be (obj, act). It is actually the rule without the subject.public boolean hasPermissionForUser(java.lang.String user,
java.util.List<java.lang.String> permission)
hasPermissionForUser 在类中 Enforceruser - the user.permission - the permission, usually be (obj, act). It is actually the rule without the subject.public java.util.List<java.lang.String> getRolesForUserInDomain(java.lang.String name,
java.lang.String domain)
getRolesForUserInDomain 在类中 Enforcername - the user.domain - the domain.public java.util.List<java.util.List<java.lang.String>> getPermissionsForUserInDomain(java.lang.String user,
java.lang.String domain)
getPermissionsForUserInDomain 在类中 Enforceruser - the user.domain - the domain.public boolean addRoleForUserInDomain(java.lang.String user,
java.lang.String role,
java.lang.String domain)
addRoleForUserInDomain 在类中 Enforceruser - the user.role - the role.domain - the domain.public boolean deleteRoleForUserInDomain(java.lang.String user,
java.lang.String role,
java.lang.String domain)
deleteRoleForUserInDomain 在类中 Enforceruser - the user.role - the role.domain - the domain.public java.util.List<java.lang.String> getImplicitRolesForUser(java.lang.String name,
java.lang.String... domain)
getRolesForUser("alice") can only get: ["role:admin"]. But getImplicitRolesForUser("alice") will get: ["role:admin", "role:user"].
getImplicitRolesForUser 在类中 Enforcername - the userdomain - the domainpublic java.util.List<java.util.List<java.lang.String>> getImplicitPermissionsForUser(java.lang.String user,
java.lang.String... domain)
getPermissionsForUser("alice") can only get: [["alice", "data2", "read"]]. But getImplicitPermissionsForUser("alice") will get: [["admin", "data1", "read"], ["alice", "data2", "read"]].
getImplicitPermissionsForUser 在类中 Enforceruser - the user.domain - the user's domain.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.