Home Reference Source
public class | source

ACL

Access Control List

It describes the read and write permission of a record to public, specific roles or users.

Static Method Summary

Static Public Methods
public static

fromJSON(attrs: Object): ACL

Constructs a new ACL object from JSON object.

Constructor Summary

Public Constructor
public

constructor(attrs: Object[])

Constructs a new ACL object.

Member Summary

Public Members
public

public: *

public

roles: {}

public

users: {}

Method Summary

Public Methods
public

hasPublicReadAccess(): Boolean

Checks if public has read access.

public

Checks if public has write access.

public

hasReadAccess(user: Record, roles: Role[]): Boolean

Checks if the specific user and role has read access.

public

hasReadAccessForRole(role: Role): Boolean

Checks if the specific role has read access.

public

hasReadAccessForUser(user: Record): Boolean

Checks if the specific user has read access.

public

hasWriteAccess(user: Record, roles: Role[]): Boolean

Checks if the specific user and role has write access.

public

hasWriteAccessForRole(role: Role): Boolean

Checks if the specific role has write access.

public

hasWriteAccessForUser(user: Record): Boolean

Checks if the specific user has write access.

public

Sets a specific role to have no access.

public

Sets a specific user to have no access.

public

Sets public to have no access.

public

Sets public to have read access only.

public

Sets public to have both read and write access.

public

Sets a specific role to have read access only.

public

Sets a specific user to have read access only.

public

Sets a specific role to have read and write access.

public

Sets a specific user to have read and write access.

public

toJSON(): *

Serializes ACL to a JSON object.

Static Public Methods

public static fromJSON(attrs: Object): ACL source

Constructs a new ACL object from JSON object.

Params:

NameTypeAttributeDescription
attrs Object

the JSON object

Return:

ACL

the created acl object

Public Constructors

public constructor(attrs: Object[]) source

Constructs a new ACL object.

Params:

NameTypeAttributeDescription
attrs Object[]

Public Members

public public: * source

public roles: {} source

public users: {} source

Public Methods

public hasPublicReadAccess(): Boolean source

Checks if public has read access.

Return:

Boolean

true if public has read access

public hasPublicWriteAccess(): Boolean source

Checks if public has write access.

Return:

Boolean

true if public has write access

public hasReadAccess(user: Record, roles: Role[]): Boolean source

Checks if the specific user and role has read access.

Params:

NameTypeAttributeDescription
user Record

the user

roles Role[]

roles

Return:

Boolean

true if the user and roles has read access

public hasReadAccessForRole(role: Role): Boolean source

Checks if the specific role has read access.

Params:

NameTypeAttributeDescription
role Role

the role

Return:

Boolean

true if the role has read access

public hasReadAccessForUser(user: Record): Boolean source

Checks if the specific user has read access.

Params:

NameTypeAttributeDescription
user Record

the user

Return:

Boolean

true if the user has read access

public hasWriteAccess(user: Record, roles: Role[]): Boolean source

Checks if the specific user and role has write access.

Params:

NameTypeAttributeDescription
user Record

the user

roles Role[]

roles

Return:

Boolean

true if the user and roles has write access

public hasWriteAccessForRole(role: Role): Boolean source

Checks if the specific role has write access.

Params:

NameTypeAttributeDescription
role Role

the role

Return:

Boolean

true if the role has write access

public hasWriteAccessForUser(user: Record): Boolean source

Checks if the specific user has write access.

Params:

NameTypeAttributeDescription
user Record

the user

Return:

Boolean

true if the user has write access

public setNoAccessForRole(role: Role) source

Sets a specific role to have no access.

Params:

NameTypeAttributeDescription
role Role

the role

public setNoAccessForUser(user: Record) source

Sets a specific user to have no access.

Params:

NameTypeAttributeDescription
user Record

the user record

public setPublicNoAccess() source

Sets public to have no access.

public setPublicReadOnly() source

Sets public to have read access only.

public setPublicReadWriteAccess() source

Sets public to have both read and write access.

public setReadOnlyForRole(role: Role) source

Sets a specific role to have read access only.

Params:

NameTypeAttributeDescription
role Role

the role

public setReadOnlyForUser(user: Record) source

Sets a specific user to have read access only.

Params:

NameTypeAttributeDescription
user Record

the user record

public setReadWriteAccessForRole(role: Role) source

Sets a specific role to have read and write access.

Params:

NameTypeAttributeDescription
role Role

the role

public setReadWriteAccessForUser(user: Record) source

Sets a specific user to have read and write access.

Params:

NameTypeAttributeDescription
user Record

the user record

public toJSON(): * source

Serializes ACL to a JSON object.

Return:

*