public class HeliosAccessControlManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALLOWED |
static java.lang.String |
DENIED |
static java.lang.String |
EGONETWORKATTRIBUTE |
static java.lang.String |
USERID |
| Constructor and Description |
|---|
HeliosAccessControlManager() |
| Modifier and Type | Method and Description |
|---|---|
HeliosAccessControlRulesTable |
getAccessRules(java.lang.String fileID)
Gets the table of access control rules for a file
The rules are of type {action,userID,"userID"}
or {action,attribute,"egonetworkattribute"} and grant access for
action to users with mentioned userID or attribute.
|
static HeliosAccessControlManager |
getInstance()
Get the singleton instance of this Manager.
|
void |
init(java.lang.String ruleBaseDir)
Init required for storing base dir.
|
void |
loadAllRules()
Load saved rules from a file and replace all current rules in accessControlRulesList.
|
boolean |
requestAccess(java.lang.String fileID,
java.lang.String action,
java.lang.String userID)
Check if the subject is allowed to perform the action with the object
|
void |
saveAllRules()
Save current rules to a file.
|
void |
setAccessRules(java.lang.String fileID,
HeliosAccessControlRulesTable rulesTable)
Sets a access control rule table for a file.
|
public static final java.lang.String ALLOWED
public static final java.lang.String DENIED
public static final java.lang.String USERID
public static final java.lang.String EGONETWORKATTRIBUTE
public static HeliosAccessControlManager getInstance()
HeliosAccessControlManagerpublic void init(java.lang.String ruleBaseDir)
ruleBaseDir - Base directory to store the rule files.public boolean requestAccess(java.lang.String fileID,
java.lang.String action,
java.lang.String userID)
fileID - The ID of the objectaction - The action the subject wants to perform with the objectuserID - The ID of the subjectpublic void setAccessRules(java.lang.String fileID,
HeliosAccessControlRulesTable rulesTable)
fileID - The object of the access policyrulesTable - the list of rules for the objectpublic HeliosAccessControlRulesTable getAccessRules(java.lang.String fileID)
fileID - The object of the access policypublic void loadAllRules()
public void saveAllRules()