| 构造器和说明 |
|---|
FileAdapter(java.io.InputStream inputStream)
FileAdapter is the constructor for FileAdapter.
|
FileAdapter(java.lang.String filePath)
FileAdapter is the constructor for FileAdapter.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPolicy(java.lang.String sec,
java.lang.String ptype,
java.util.List<java.lang.String> rule)
addPolicy adds a policy rule to the storage.
|
void |
loadPolicy(Model model)
loadPolicy loads all policy rules from the storage.
|
void |
removeFilteredPolicy(java.lang.String sec,
java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
removeFilteredPolicy removes policy rules that match the filter from the storage.
|
void |
removePolicy(java.lang.String sec,
java.lang.String ptype,
java.util.List<java.lang.String> rule)
removePolicy removes a policy rule from the storage.
|
void |
savePolicy(Model model)
savePolicy saves all policy rules to the storage.
|
public FileAdapter(java.lang.String filePath)
filePath - the path of the policy file.public FileAdapter(java.io.InputStream inputStream)
inputStream - the policy file.inputStreampublic void loadPolicy(Model model)
loadPolicy 在接口中 Adaptermodel - the model.public void savePolicy(Model model)
savePolicy 在接口中 Adaptermodel - the model.public void addPolicy(java.lang.String sec,
java.lang.String ptype,
java.util.List<java.lang.String> rule)
public void removePolicy(java.lang.String sec,
java.lang.String ptype,
java.util.List<java.lang.String> rule)
removePolicy 在接口中 Adaptersec - the section, "p" or "g".ptype - the policy type, "p", "p2", .. or "g", "g2", ..rule - the rule, like (sub, obj, act).public void removeFilteredPolicy(java.lang.String sec,
java.lang.String ptype,
int fieldIndex,
java.lang.String... fieldValues)
removeFilteredPolicy 在接口中 Adaptersec - the section, "p" or "g".ptype - the policy type, "p", "p2", .. or "g", "g2", ..fieldIndex - the policy rule's start index to be matched.fieldValues - the field values to be matched, value ""
means not to match this field.Copyright © 2017–2021. All rights reserved.