Members
dataONEObject :DataONEObject
The DataONEObject that will be saved with this AccessPolicy
Type:
Methods
createDefaultPolicy()
Creates AccessRule member models from the `defaultAccessPolicy`
setting in the AppModel.
getSubjectInfo()
Gets the subject info for all of the subjects in this access policy.
Sets the subject info on each corresponding model.
hasOwner() → {boolean}
Checks if there is at least one AccessRule with changePermission permission
in this AccessPolicy.
Returns:
- Type
- boolean
isAuthorized(action) → {boolean}
Checks if the current user is authorized to perform the given action
based on the current access rules in this collection
Parameters:
Name | Type | Description |
---|---|---|
action |
string | The action to check authorization for. Can be either `read`, `write`, or `changePermission` |
Returns:
- Returns true is the user can perform this action,
false if not.
- Type
- boolean
isPublic() → {boolean}
Returns true if this access policy specifies that it is accessible to
the public in any way
Returns:
- Type
- boolean
makePrivate()
Removes access rules that grant public access and sets an access rule
that denies public read.
makePublic()
Removes any AccessRule that denies public read and adds an AccessRule
that allows public read
parse(The)
Parses the given access policy XML and creates AccessRule models for
each rule in the access policy XML. Adds these models to this collection.
Parameters:
Name | Type | Description |
---|---|---|
The |
Element |
removeAccessRule(accessRule)
Remove the given AccessRule from this AccessPolicy
Parameters:
Name | Type | Description |
---|---|---|
accessRule |
AccessRule | The AccessRule model to remove |
serialize() → {string}
Creates an access policy XML from the values set on the member
AccessRule models.
Returns:
A string of the access policy XML
- Type
- string