Home Reference Source
import {Acl} from './core/acl.js'
public class | source

Acl

The Acl class is used as a wrapper for reading and setting permissions on an entity level.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get
public

entity: *

public set
public set
public get
public get

readers: string[]: *

public get
public get

writers: string[]: *

Method Summary

Public Methods
public

addReader(user: string): Acl

Add a reader.

public

Add a reader group.

public

addWriter(user: string): Acl

Add a writer.

public

Add a writer group.

public

Check if global reading is allowed.

public

Check if global writing is allowed.

public

Remove a reader.

public

Remove a reader group.

public

Remove a writer.

public

Remove a writer group.

public

The acl as a plain object.

Public Constructors

public constructor() source

Public Members

public get creator: string: * source

Return:

string

Creator

public entity: * source

public set globallyReadable(gr: boolean) source

public set globallyWritable(gw: boolean) source

public get readerGroups: string[]: * source

Return:

string[]

Reader Groups

public get readers: string[]: * source

Return:

string[]

Readers

public get writerGroups: string[]: * source

Return:

string[]

Writer Groups

public get writers: string[]: * source

Return:

string[]

Writers

Public Methods

public addReader(user: string): Acl source

Add a reader.

Params:

NameTypeAttributeDescription
user string

Reader

Return:

Acl

Acl instance

public addReaderGroup(group: string): Acl source

Add a reader group.

Params:

NameTypeAttributeDescription
group string

Reader group

Return:

Acl

Acl instance

public addWriter(user: string): Acl source

Add a writer.

Params:

NameTypeAttributeDescription
user string

Writer

Return:

Acl

Acl instance

public addWriterGroup(group: string): Acl source

Add a writer group.

Params:

NameTypeAttributeDescription
group string

Writer group

Return:

Acl

Acl instance

public isGloballyReadable(): boolean source

Check if global reading is allowed.

Return:

boolean

True if global reading is allowed otherwise false.

public isGloballyWritable(): boolean source

Check if global writing is allowed.

Return:

boolean

True if global writing is allowed otherwise false.

public removeReader(user: string): Acl source

Remove a reader.

Params:

NameTypeAttributeDescription
user string

Reader

Return:

Acl

Acl instance

public removeReaderGroup(group: string): Acl source

Remove a reader group.

Params:

NameTypeAttributeDescription
group string

Reader group

Return:

Acl

Acl instance

public removeWriter(user: string): Acl source

Remove a writer.

Params:

NameTypeAttributeDescription
user string

Writer

Return:

Acl

Acl instance

public removeWriterGroup(group: string): Acl source

Remove a writer group.

Params:

NameTypeAttributeDescription
group string

Writer group

Return:

Acl

Acl instance

public toPlainObject(): Object source

The acl as a plain object.

Return:

Object

Acl as a plain object.