public class SyncedEnforcer extends Enforcer
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGroupingPolicies(java.util.List<java.util.List<java.lang.String>> rules)
addGroupingPolicies adds role inheritance rules to the current policy.
|
boolean |
addGroupingPolicies(java.lang.String[][] rules)
addGroupingPolicies adds role inheritance rules to the current policy.
|
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 |
addNamedGroupingPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
addNamedGroupingPolicies adds named role inheritance rules to the current policy.
|
boolean |
addNamedGroupingPolicies(java.lang.String ptype,
java.lang.String[][] rules)
addNamedGroupingPolicies adds named role inheritance rules 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 |
addNamedPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
addNamedPolicies adds authorization rules to the current named policy.
|
boolean |
addNamedPoliciesEx(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
addNamedPoliciesEx adds authorization rules to the current named 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 |
addPolicies(java.util.List<java.util.List<java.lang.String>> rules)
addPolicies adds authorization rules to the current policy.
|
boolean |
addPolicies(java.lang.String[][] rules)
addPolicies adds authorization rules to the current 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.
|
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).
|
EnforceResult |
enforceEx(java.lang.Object... rvals)
enforceEx decides whether a "subject" can access "object" with
the operation "action", input parameters are usually: (sub, obj, act).
|
EnforceResult |
enforceExWithMatcher(java.lang.String matcher,
java.lang.Object... rvals)
enforceExWithMatcher 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.
|
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>> |
getNamedImplicitPermissionsForUser(java.lang.String pType,
java.lang.String user,
java.lang.String... domain)
GetNamedImplicitPermissionsForUser gets implicit permissions for a user or role by named policy.
|
java.util.List<java.util.List<java.lang.String>> |
getNamedPermissionsForUser(java.lang.String pType,
java.lang.String user,
java.lang.String... domain)
GetNamedPermissionsForUser gets permissions for a user or role by named 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.
|
java.util.List<java.lang.String> |
getUsersForRoleInDomain(java.lang.String name,
java.lang.String domain)
getUsersForRoleInDomain gets the users that a role has inside a domain.
|
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.
|
boolean |
isAutoLoadingRunning() |
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 |
removeGroupingPolicies(java.util.List<java.util.List<java.lang.String>> rules)
removeGroupingPolicies removes role inheritance rules from the current policy.
|
boolean |
removeGroupingPolicies(java.lang.String[][] rules)
removeGroupingPolicies removes role inheritance rules from the current policy.
|
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 |
removeNamedGroupingPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
removeNamedGroupingPolicies removes role inheritance rules from the current named policy.
|
boolean |
removeNamedGroupingPolicies(java.lang.String ptype,
java.lang.String[][] rules)
removeNamedGroupingPolicies removes role inheritance rules from the current named 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 |
removeNamedPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
removeNamedPolicies removes authorization rules 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 |
removePolicies(java.util.List<java.util.List<java.lang.String>> rules)
removePolicies removes authorization rules from the current policy.
|
boolean |
removePolicies(java.lang.String[][] rules)
removePolicies removes authorization rules from the current 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.
|
void |
startAutoLoadPolicy(long d) |
void |
stopAutoLoadPolicy() |
boolean |
updateGroupingPolicy(java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
UpdateGroupingPolicy updates an authorization rule to the current named policy.
|
boolean |
updateNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updateNamedGroupingPolicy updates an authorization rule to the current named 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.
|
getImplicitPermissionsForUserInDomain, getImplicitUsersForRole, updatePermissionForUseraddFunction, getAllNamedSubjects, getPermittedActionsaddNamedDomainLinkConditionFunc, addNamedDomainMatchingFunc, addNamedLinkConditionFunc, addNamedMatchingFunc, buildConditionalRoleLinks, enableAcceptJsonRequest, enableAutoBuildRoleLinks, enableAutoSave, enableEnforce, enableLog, getAdapter, getAviatorEval, getModel, getNamedRoleManager, getRmMap, getRoleManager, isAutoNotifyDispatcher, isAutoNotifyWatcher, isFiltered, loadModel, mustUseDispatcher, newModel, newModel, newModel, resetExpressionEvaluator, setAdapter, setAutoNotifyDispatcher, setAutoNotifyWatcher, setAviatorEvaluator, setDispatcher, setEffector, setModel, setNamedDomainLinkConditionFuncParams, setNamedLinkConditionFuncParams, setNamedRoleManager, 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 boolean isAutoLoadingRunning()
public void startAutoLoadPolicy(long d)
public void stopAutoLoadPolicy()
public void setWatcher(Watcher watcher)
setWatcher in class CoreEnforcerwatcher - the watcher.public void clearPolicy()
clearPolicy in class CoreEnforcerpublic void loadPolicy()
loadPolicy in class CoreEnforcerpublic void loadFilteredPolicy(java.lang.Object filter)
loadFilteredPolicy in class CoreEnforcerfilter - the filter used to specify which type of policy should be loaded.public void savePolicy()
savePolicy in class CoreEnforcerpublic void buildRoleLinks()
buildRoleLinks in class CoreEnforcerpublic boolean enforce(java.lang.Object... rvals)
enforce in class 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 in class 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 EnforceResult enforceEx(java.lang.Object... rvals)
enforceEx in class CoreEnforcerrvals - the request needs to be mediated, usually an array
of strings, can be class instances if ABAC is used.public EnforceResult enforceExWithMatcher(java.lang.String matcher, java.lang.Object... rvals)
enforceExWithMatcher in class 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 in class 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 in class Enforcermatcher - the custom matcher.rules - the rules.public java.util.List<java.lang.String> getAllSubjects()
getAllSubjects in class ManagementEnforcerpublic java.util.List<java.lang.String> getAllObjects()
getAllObjects in class ManagementEnforcerpublic java.util.List<java.lang.String> getAllNamedObjects(java.lang.String ptype)
getAllNamedObjects in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllActions()
getAllActions in class ManagementEnforcerpublic java.util.List<java.lang.String> getAllNamedActions(java.lang.String ptype)
getAllNamedActions in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..public java.util.List<java.lang.String> getAllRoles()
getAllRoles in class ManagementEnforcerpublic java.util.List<java.lang.String> getAllNamedRoles(java.lang.String ptype)
getAllNamedRoles in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..public java.util.List<java.util.List<java.lang.String>> getPolicy()
getPolicy in class ManagementEnforcerpublic java.util.List<java.util.List<java.lang.String>> getFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
getFilteredPolicy in class 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 in class 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 in class 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 in class ManagementEnforcerpublic java.util.List<java.lang.String> getRolesForUser(java.lang.String name)
getRolesForUser in class Enforcername - the user.public java.util.List<java.util.List<java.lang.String>> getFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
getFilteredGroupingPolicy in class 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 in class 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 in class 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 in class ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean hasPolicy(java.lang.String... params)
hasPolicy in class 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 in class 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 in class 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 in class ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean addPolicies(java.util.List<java.util.List<java.lang.String>> rules)
addPolicies in class ManagementEnforcerrules - the "p" policy rules, ptype "p" is implicitly used.public boolean updatePolicy(java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updatePolicy in class ManagementEnforcerparams1 - the old rule.params2 - the new rule.public boolean addPolicy(java.lang.String... params)
addPolicy in class ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean addPolicies(java.lang.String[][] rules)
addPolicies in class ManagementEnforcerrules - the "p" policy rules, ptype "p" is implicitly used.public boolean addNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
addNamedPolicy in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean addNamedPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
addNamedPolicies in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..rules - the "p" policy rules.public boolean addNamedPoliciesEx(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
addNamedPoliciesEx in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..rules - the "p" policy rules.public boolean updateNamedPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updateNamedPolicy in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params1 - the old rule.params2 - the new rule.public boolean updateGroupingPolicy(java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updateGroupingPolicy in class ManagementEnforcerparams1 - the old rule.params2 - the new rule.public boolean updateNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params1,
java.util.List<java.lang.String> params2)
updateNamedGroupingPolicy in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params1 - the old rule.params2 - the new rule.public boolean addNamedPolicy(java.lang.String ptype,
java.lang.String... params)
addNamedPolicy in class 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 in class ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean removePolicy(java.lang.String... params)
removePolicy in class ManagementEnforcerparams - the "p" policy rule, ptype "p" is implicitly used.public boolean removePolicies(java.util.List<java.util.List<java.lang.String>> rules)
removePolicies in class ManagementEnforcerrules - the "p" policy rules, ptype "p" is implicitly used.public boolean removePolicies(java.lang.String[][] rules)
removePolicies in class ManagementEnforcerrules - the "p" policy rules, ptype "p" is implicitly used.public boolean removeFilteredPolicy(int fieldIndex,
java.lang.String... fieldValues)
removeFilteredPolicy in class 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 in class 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 in class ManagementEnforcerptype - the policy type, can be "p", "p2", "p3", ..params - the "p" policy rule.public boolean removeNamedPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
removeNamedPolicies in class ManagementEnforcerptype - ptype the policy type, can be "p", "p2", "p3", ..rules - the "p" policy rules.public boolean removeFilteredNamedPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
removeFilteredNamedPolicy in class 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 in class ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean hasGroupingPolicy(java.lang.String... params)
hasGroupingPolicy in class 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 in class 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 in class 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 in class ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean addGroupingPolicy(java.lang.String... params)
addGroupingPolicy in class ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean addGroupingPolicies(java.util.List<java.util.List<java.lang.String>> rules)
addGroupingPolicies in class ManagementEnforcerrules - the "g" policy rules, ptype "g" is implicitly used.public boolean addGroupingPolicies(java.lang.String[][] rules)
addGroupingPolicies in class ManagementEnforcerrules - the "g" policy rules, ptype "g" is implicitly used.public boolean addNamedGroupingPolicy(java.lang.String ptype,
java.util.List<java.lang.String> params)
addNamedGroupingPolicy in class 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 in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean addNamedGroupingPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
addNamedGroupingPolicies in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..rules - the "g" policy rules.public boolean addNamedGroupingPolicies(java.lang.String ptype,
java.lang.String[][] rules)
addNamedGroupingPolicies in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..rules - the "g" policy rules.public boolean removeGroupingPolicy(java.util.List<java.lang.String> params)
removeGroupingPolicy in class ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean removeGroupingPolicy(java.lang.String... params)
removeGroupingPolicy in class ManagementEnforcerparams - the "g" policy rule, ptype "g" is implicitly used.public boolean removeGroupingPolicies(java.util.List<java.util.List<java.lang.String>> rules)
removeGroupingPolicies in class ManagementEnforcerrules - the "g" policy rules, ptype "g" is implicitly used.public boolean removeGroupingPolicies(java.lang.String[][] rules)
removeGroupingPolicies in class ManagementEnforcerrules - the "g" policy rules, ptype "g" is implicitly used.public boolean removeFilteredGroupingPolicy(int fieldIndex,
java.lang.String... fieldValues)
removeFilteredGroupingPolicy in class 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 in class 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 in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..params - the "g" policy rule.public boolean removeNamedGroupingPolicies(java.lang.String ptype,
java.util.List<java.util.List<java.lang.String>> rules)
removeNamedGroupingPolicies in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..rules - the "g" policy rules.public boolean removeNamedGroupingPolicies(java.lang.String ptype,
java.lang.String[][] rules)
removeNamedGroupingPolicies in class ManagementEnforcerptype - the policy type, can be "g", "g2", "g3", ..rules - the "g" policy rules.public boolean removeFilteredNamedGroupingPolicy(java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
removeFilteredNamedGroupingPolicy in class 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 in class Enforcername - the role.public boolean hasRoleForUser(java.lang.String name,
java.lang.String role)
hasRoleForUser in class Enforcername - the user.role - the role.public boolean addRoleForUser(java.lang.String user,
java.lang.String role)
addRoleForUser in class Enforceruser - the user.role - the role.public boolean deleteRoleForUser(java.lang.String user,
java.lang.String role)
deleteRoleForUser in class Enforceruser - the user.role - the role.public boolean deleteRolesForUser(java.lang.String user)
deleteRolesForUser in class Enforceruser - the user.public boolean deleteUser(java.lang.String user)
deleteUser in class Enforceruser - the user.public void deleteRole(java.lang.String role)
deleteRole in class Enforcerrole - the role.public boolean deletePermission(java.lang.String... permission)
deletePermission in class 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 in class 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 in class 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 in class 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 in class 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 in class 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 in class Enforceruser - the user.public java.util.List<java.util.List<java.lang.String>> getPermissionsForUser(java.lang.String user,
java.lang.String... domain)
getPermissionsForUser in class Enforceruser - the user.domain - the user's domain.public java.util.List<java.util.List<java.lang.String>> getNamedPermissionsForUser(java.lang.String pType,
java.lang.String user,
java.lang.String... domain)
pType - the name policy.user - the user.domain - domain.public boolean hasPermissionForUser(java.lang.String user,
java.lang.String... permission)
hasPermissionForUser in class 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 in class 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> getUsersForRoleInDomain(java.lang.String name,
java.lang.String domain)
getUsersForRoleInDomain in class Enforcername - the role.domain - the domain.public java.util.List<java.lang.String> getRolesForUserInDomain(java.lang.String name,
java.lang.String domain)
getRolesForUserInDomain in class 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 in class Enforceruser - the user.domain - the domain.public boolean addRoleForUserInDomain(java.lang.String user,
java.lang.String role,
java.lang.String domain)
addRoleForUserInDomain in class 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 in class 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 in class 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 in class Enforceruser - the user.domain - the user's domain.public java.util.List<java.util.List<java.lang.String>> getNamedImplicitPermissionsForUser(java.lang.String pType,
java.lang.String user,
java.lang.String... domain)
GetImplicitPermissionsForUser("alice") can only get: [["admin", "data1", "read"]], whose policy is default policy "p" But you can specify the named policy "p2" to get: [["admin", "create"]] by GetNamedImplicitPermissionsForUser("p2","alice")
getNamedImplicitPermissionsForUser in class EnforcerpType - the name policy.user - 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–2025. All rights reserved.