Constructor
new AccessPolicyView()
- Source:
Extends
Members
broadcast :boolean
Whether or not changes to the accessPolicy managed by this view will be
broadcasted to the accessPolicy of the editor's rootDataPackage's
packageModle.
This implementation is very likely to change in the future as we iron out
how to handle bulk accessPolicy (and other) changes.
Type:
- Since:
- Source:
cachedModels :Array.<AccessRule>
Used to track the collection of models set on the view in order to handle
undoing all changes made when we either hit Cancel or click otherwise
hide the modal (such as clicking outside of it).
Type:
- Since:
- Source:
className :string
The HTML classes to use for this view's element
Type:
- Source:
The AccessPolicy collection that is displayed in this View
Type:
- Source:
events :Object
The events this view will listen to and the associated function to call.
Type:
- Source:
publicToggleSection :string
A selector for the element in this view that contains the public/private toggle section
Type:
- Since:
- Source:
resourceType :string
The type of object/resource that this AccessPolicy is for. This is used for display purposes only.
Type:
- Source:
Example
"dataset", "portal", "data file"
template :Underscore.Template
References to templates for this view. HTML files are converted to Underscore.js templates
Type:
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
addAccessRule(accessRule)
Adds the given AccessRule model to the AccessPolicy collection associated with this view
Parameters:
Name |
Type |
Description |
accessRule |
AccessRule
|
The AccessRule to add |
- Source:
addEmptyRow()
Render a row with input elements for adding a new AccessRule
- Source:
checkForOwners(accessRuleModel)
Checks that there is at least one owner of this resource, and displays a warning message if not.
Parameters:
- Source:
getPublicToggleHelpText() → {string}
Constructs and returns a message that explains if this resource is public or private. This message is displayed
in the tooltip for the public/private toggle or in place of the toggle when the toggle is disabled. Override this
function to create a custom message.
- Since:
- Source:
Returns:
-
Type
-
string
handleRemove(e)
Checks that there is at least one owner of this resource, and displays a warning message if not.
Parameters:
Name |
Type |
Description |
e |
Event
|
|
- Source:
initialize(options)
Creates a new AccessPolicyView
Parameters:
Name |
Type |
Description |
options |
Object
|
A literal object with options to pass to the view |
- Source:
render()
Renders this view
- Source:
renderHelpText()
Renders help text for the form in this view
- Source:
renderPublicToggle()
Renders a public/private toggle that toggles the public readability of the given resource.
- Source:
reset()
Resets the state of the models stored in the view's collection to the
latest cached copy. Triggered either when the Cancel button is hit or
the modal containing this view is hidden.
- Since:
- Source:
save()
Saves the AccessPolicy associated with this view
- Source:
showOwnerWarning()
Displays a warning message in this view that the object needs at least one owner.
- Source:
showRightsholder()
Adds an AccessRuleView that represents the rightsHolder of the object.
The rightsHolder needs to be handled specially because it's not a regular access rule in the system metadata.
- Source:
showSaveProgress(dataONEObject)
Show visual cues in this view to show the user the status of the system metadata update.
Parameters:
Name |
Type |
Description |
dataONEObject |
DataONEObject
|
The object being updated |
- Source:
showUnauthorized()
Adds messaging to this view to tell the user they are unauthorized to change the AccessPolicy
of this object(s)
- Source:
togglePrivacy()
Toggles the public-read AccessRule for this resource
- Source: