Class: ACL

ACL

Access Control List (ACL) allows you to control who can access the content of your application.

new ACL(data){ACL}

acl.js, line 13
Use this to get an ACL instance which can then be passed to any method that accepts an ACL instance as argument.
Name Type Description
data object Plain JavaScript object specifying initial ACL.
Example
// Constructor with blank ACL
var acl = Built.ACL();
//Constructor with initial ACL
var acl = Built.ACL({
   others:{
     read:true
   }
}) 

Methods

canDelete(){Boolean}

acl.js, line 453
Tells whether the user has delete access
Example
var acl = Built.ACL();
var boolean = acl.canDelete();

canUpdate(){Boolean}

acl.js, line 439
Tells whether the user has update access
Example
var acl = Built.ACL();
var boolean = acl.canUpdate();

disable(){ACL}

acl.js, line 407
Disables ACL.
Example
var acl = Built.ACL();
acl = acl.disable();

enable(){ACL}

acl.js, line 423
Enables ACL
Example
var acl = Built.ACL();
acl = acl.enable();

getPublicDeleteAccess(){Boolean}

acl.js, line 69
Checks whether the object can be deleted by anyone
Example
var acl = Built.ACL();
var boolean = acl.getPublicDeleteAccess();

getPublicReadAccess(){Boolean}

acl.js, line 84
Determines whether the object can be read by anyone
Example
var acl = Built.ACL();
var boolean = acl.getPublicReadAccess();

getPublicUpdateAccess(){Boolean}

acl.js, line 99
Determines whether the object can be updated by anyone
Example
var acl = Built.ACL();
var boolean = acl.getPublicUpdateAccess();

getRoleDeleteAccess(uid){Boolean}

acl.js, line 114
Determines whether the user with the given role is allowed to delete the object. Even if this returns false, the user may still be able to access it, if getPublicDeleteAccess() returns true, or if the user belongs to another role that has delete access.
Name Type Description
uid String Role's uid
Example
var acl = Built.ACL();
var boolean = acl.getRoleDeleteAccess('uid');

getRoleReadAccess(uid){Boolean}

acl.js, line 131
Determines whether the user with the given role is allowed to read the object. Even if this returns false, the user may still be able to read it, if getPublicReadAccess() returns true, or if the user belongs to another role that has read access.
Name Type Description
uid String Role's uid
Example
var acl = Built.ACL();
var boolean = acl.getRoleReadAccess('uid');

getRoleUpdateAccess(uid){Boolean}

acl.js, line 148
Determines whether the user with the given role is allowed to update this object. Even if this returns false, the user may still be able to update it, if getPublicUpdateAccess() returns true, or if the user belongs to another role that has update access.
Name Type Description
uid String Role's uid
Example
var acl  = Built.ACL();
var boolean = acl.getRoleUpdateAccess('uid');

getUserDeleteAccess(uid){Boolean}

acl.js, line 164
Checks whether the user is allowed to delete the object. Even if this returns false, the user may still be able to delete it, if getPublicDeleteAccess() returns true, or if the user belongs to a role that has delete access.
Name Type Description
uid String Role's uid
Example
var acl = Built.ACL();
var boolean = acl.getUserDeleteAccess('uid');

getUserReadAccess(uid){Boolean}

acl.js, line 180
Determines whether the user is allowed to read the object. Even if this returns false, the user may still be able to read it, if getPublicReadAccess() returns true, or if the user belongs to a role that has read access.
Name Type Description
uid String Application User's uid
Example
var acl = Built.ACL();
var boolean = acl.getUserReadAccess('uid');

getUserUpdateAccess(uid){Boolean}

acl.js, line 196
Determines whether the user is allowed to update this object. Even if this returns false, the user may still be able to update it, if getPublicUpdateAccess() returns true, or if the user belongs to a role that has update access.
Name Type Description
uid String Application User's uid
Example
var acl = Built.ACL();
var boolean = acl.getUserUpdateAccess('uid');

isDisabled(){Boolean}

acl.js, line 212
Determines whether the ACL is disabled or not
Example
var acl = Built.ACL();
var boolean = acl.isDisabled();

setAnonymousDeleteAccess(allowed){ACL}

acl.js, line 367
Delete permission will be assigned/unassigned to the anonymous users(non logged-in users).
Name Type Description
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setAnonymousDeleteAccess(true);

setAnonymousReadAccess(allowed){ACL}

acl.js, line 393
Read permission will be assigned/unassigned to the anonymous users(non logged-in users).
Name Type Description
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setAnonymousReadAccess(true);

setAnonymousUpdateAccess(allowed){ACL}

acl.js, line 380
Update permission will be assigned/unassigned to the anonymous users(non logged-in users).
Name Type Description
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setAnonymousUpdateAccess(true);

setPublicDeleteAccess(allowed){ACL}

acl.js, line 226
Sets whether users' falling into 'others' category are allowed to delete this object or not
Name Type Description
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setPublicDeleteAccess(true);

setPublicReadAccess(allowed){ACL}

acl.js, line 262
Sets whether users' falling into 'others' category are allowed to read access or not
Name Type Description
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setPublicReadAccess(true);

setPublicUpdateAccess(allowed){ACL}

acl.js, line 244
Sets whether users' falling into 'others' category are allowed to update this object or not
Name Type Description
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setPublicUpdateAccess(true);

setRoleDeleteAccess(uid, allowed){ACL}

acl.js, line 281
Delete permission will be assigned/unassigned to the role whose uid is provided
Name Type Description
uid String Uid of role
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setRoleDeleteAccess('uid',true);

setRoleReadAccess(uid, allowed){ACL}

acl.js, line 310
Read permission will be assigned/unassigned to the role whose uid is provided
Name Type Description
uid String Uid of role
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setRoleReadAccess('uid',true);

setRoleUpdateAccess(uid, allowed){ACL}

acl.js, line 296
Update permission will be assigned/unassigned to the role whose uid is provided
Name Type Description
uid String Uid of role
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setRoleUpdateAccess('uid',true);

setUserDeleteAcces(uid, allowed){ACL}

acl.js, line 324
Delete permission will be assigned/unassigned to the user whose uid is provided
Name Type Description
uid String Uid of user
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setUserDeleteAccess('uid',true);

setUserReadAccess(uid, allowed){ACL}

acl.js, line 352
Read permission will be assigned/unassigned to the user whose uid is provided
Name Type Description
uid String Uid of user
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setUserReadAccess('uid',true);

setUserUpdateAccess(uid, allowed){ACL}

acl.js, line 338
Update permission will be assigned/unassigned to the user whose uid is provided
Name Type Description
uid String Uid of user
allowed Boolean Access allowed or not (true|false)
Example
var acl = Built.ACL();
acl = acl.setUserUpdateAccess('uid',true);