Constructor
    
    
    
      
        
      
      new AccessPolicy()
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
    
     
    
        Extends
        
    
    
    
    
    
    
    
    
        Members
        
            
    The DataONEObject that will be saved with this AccessPolicy
    Type:
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
    
    
        Methods
        
            
    
    
    
      
        
      
      copyAccessPolicy(otherAccessPolicy)
    
    
    
    Copies all the AccessRules from the given AccessPolicy and replaces this AccessPolicy
    Parameters:
    
    
    
    - Since:
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
Fires:
    - Backbone.Collection#event:reset
 
        
            
    
    
    
      
        
      
      createDefaultPolicy()
    
    
    
    Creates AccessRule member models from the `defaultAccessPolicy`
setting in the AppModel.
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
            
    
    
    
      
        
      
      getSubjectInfo()
    
    
    
    Gets the subject info for all of the subjects in this access policy.
Sets the subject info on each corresponding model.
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
            
    
    
    
      
        
      
      hasOwner() → {boolean}
    
    
    
    Checks if there is at least one AccessRule with changePermission permission
in this AccessPolicy.
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
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` | 
        
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
Returns:
        
    - Returns true is the user can perform this action,
  false if not.
    - 
        Type
    
 
    - 
        
boolean
    
 
    
        
            
    
    
    
    
    
    Checks if the user is authorized to update the system metadata.
Updates to system metadata will fail if the user doesn't have changePermission permission,
*unless* the user is performing an update() at the same time and has `write` permission
    
    
    - Since:
 
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
Returns:
        
    - 
        Type
    
 
    - 
        
boolean
    
 
    
        
            
    
    
    
      
        
      
      isPublic() → {boolean}
    
    
    
    Returns true if this access policy specifies that it is accessible to
the public in any way
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
Returns:
        
    - 
        Type
    
 
    - 
        
boolean
    
 
    
        
            
    
    
    
      
        
      
      makePrivate()
    
    
    
    Removes access rules that grant public access and sets an access rule
that denies public read.
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
            
    
    
    
      
        
      
      makePublic()
    
    
    
    Removes any AccessRule that denies public read and adds an AccessRule
that allows public read
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
            
    
    
    
      
        
      
      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
            
             | 
            
            
             XML DOM that contains a set of
  access rules. | 
        
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
            
    
    
    
      
        
      
      removeAccessRule(accessRule)
    
    
    
    Remove the given AccessRule from this AccessPolicy
    Parameters:
    
    
    
        
        | Name | 
        
        Type | 
        
        
        Description | 
    
    
    
    
        
            
                accessRule | 
            
            
            
                
AccessRule
            
             | 
            
            
            The AccessRule model to remove | 
        
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
        
            
    
    
    
      
        
      
      serialize() → {object}
    
    
    
    Creates an access policy XML from the values set on the member
AccessRule models.
    
    
    
    
    
    
    
    
    
    
    
    
    
    - Source:
 
    
    
    
    
    
Returns:
        
    A XML object of the access policy or null if empty
    - 
        Type
    
 
    - 
        
object