AccessMode

Tinode. AccessMode

new AccessMode(acs)

Helper class for handling access mode.
Source:
Parameters:
Name Type Description
acs AccessMode | Object AccessMode to copy or access mode object received from the server.

Methods

(static) diff(a1, a2) → {number}

Bits present in a1 but missing in a2.
Source:
Parameters:
Name Type Description
a1 number | string access mode to subtract from.
a2 number | string access mode to subtract.
Returns:
Type:
number
access mode with bits present in a1 but missing in a2

(static) getExcessive() → {string}

Get permissions present in 'given' but missing in 'want'. Inverse of Tinode.AccessMode#getMissing
Source:
Returns:
Type:
string
permissions present in given but missing in want.

(static) getGiven() → {string}

Get 'given' value as a string.
Source:
Returns:
Type:
string
- given value.

(static) getMissing() → {string}

Get permissions present in 'want' but missing in 'given'. Inverse of Tinode.AccessMode#getExcessive
Source:
Returns:
Type:
string
permissions present in want but missing in given.

(static) getMode() → {string}

Get 'mode' value as a string.
Source:
Returns:
Type:
string
- mode value.

(static) getWant() → {string}

Get 'want' value as a string.
Source:
Returns:
Type:
string
- want value.

(static) isAdmin(sideopt) → {boolean}

Check if either one of Owner (O) or Approver (A) flags is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isApprover(sideopt) → {boolean}

Check if Approver (A) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isDeleter(sideopt) → {boolean}

Check if Deleter (D) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isJoiner(sideopt) → {boolean}

Check if Join (J) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isMuted(sideopt) → {boolean}

Check if Presence (P) flag is NOT set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isOwner(sideopt) → {boolean}

Check if Owner (O) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isPresencer(sideopt) → {boolean}

Check if Presence (P) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isReader(sideopt) → {boolean}

Check if Reader (R) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isSharer(sideopt) → {boolean}

Check if either one of Owner (O), Approver (A), or Sharer (S) flags is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isWriter(sideopt) → {boolean}

Check if Writer (W) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) setGiven(g) → {AccessMode}

Assign 'given' value.
Source:
Parameters:
Name Type Description
g string | number either a string representation of the access mode or a set of bits.
Returns:
Type:
AccessMode
- this AccessMode.

(static) setMode(m) → {AccessMode}

Assign value to 'mode'.
Source:
Parameters:
Name Type Description
m string | number either a string representation of the access mode or a set of bits.
Returns:
Type:
AccessMode
- this AccessMode.

(static) setWant(w) → {AccessMode}

Assign 'want' value.
Source:
Parameters:
Name Type Description
w string | number either a string representation of the access mode or a set of bits.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateAll(val) → {AccessMode}

Update 'want', 'give', and 'mode' values.
Source:
Parameters:
Name Type Description
val AccessMode new access mode value.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateGiven(u) → {AccessMode}

Update 'given' value.
Source:
Parameters:
Name Type Description
u string string representation of the changes to apply to access mode.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateMode(u) → {AccessMode}

Update 'mode' value.
Source:
Parameters:
Name Type Description
u string string representation of the changes to apply to access mode.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateWant(u) → {AccessMode}

Update 'want' value.
Source:
Parameters:
Name Type Description
u string string representation of the changes to apply to access mode.
Returns:
Type:
AccessMode
- this AccessMode.

Tinode. AccessMode

new AccessMode()

AccessMode is a class representing topic access mode.
Source:

Methods

(static) diff(a1, a2) → {number}

Bits present in a1 but missing in a2.
Source:
Parameters:
Name Type Description
a1 number | string access mode to subtract from.
a2 number | string access mode to subtract.
Returns:
Type:
number
access mode with bits present in a1 but missing in a2

(static) getExcessive() → {string}

Get permissions present in 'given' but missing in 'want'. Inverse of Tinode.AccessMode#getMissing
Source:
Returns:
Type:
string
permissions present in given but missing in want.

(static) getGiven() → {string}

Get 'given' value as a string.
Source:
Returns:
Type:
string
- given value.

(static) getMissing() → {string}

Get permissions present in 'want' but missing in 'given'. Inverse of Tinode.AccessMode#getExcessive
Source:
Returns:
Type:
string
permissions present in want but missing in given.

(static) getMode() → {string}

Get 'mode' value as a string.
Source:
Returns:
Type:
string
- mode value.

(static) getWant() → {string}

Get 'want' value as a string.
Source:
Returns:
Type:
string
- want value.

(static) isAdmin(sideopt) → {boolean}

Check if either one of Owner (O) or Approver (A) flags is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isApprover(sideopt) → {boolean}

Check if Approver (A) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isDeleter(sideopt) → {boolean}

Check if Deleter (D) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isJoiner(sideopt) → {boolean}

Check if Join (J) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isMuted(sideopt) → {boolean}

Check if Presence (P) flag is NOT set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isOwner(sideopt) → {boolean}

Check if Owner (O) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isPresencer(sideopt) → {boolean}

Check if Presence (P) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isReader(sideopt) → {boolean}

Check if Reader (R) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isSharer(sideopt) → {boolean}

Check if either one of Owner (O), Approver (A), or Sharer (S) flags is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) isWriter(sideopt) → {boolean}

Check if Writer (W) flag is set.
Source:
Parameters:
Name Type Attributes Description
side string <optional>
which permission to check: given, want, mode; default: mode.
Returns:
Type:
boolean
- true if flag is set.

(static) setGiven(g) → {AccessMode}

Assign 'given' value.
Source:
Parameters:
Name Type Description
g string | number either a string representation of the access mode or a set of bits.
Returns:
Type:
AccessMode
- this AccessMode.

(static) setMode(m) → {AccessMode}

Assign value to 'mode'.
Source:
Parameters:
Name Type Description
m string | number either a string representation of the access mode or a set of bits.
Returns:
Type:
AccessMode
- this AccessMode.

(static) setWant(w) → {AccessMode}

Assign 'want' value.
Source:
Parameters:
Name Type Description
w string | number either a string representation of the access mode or a set of bits.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateAll(val) → {AccessMode}

Update 'want', 'give', and 'mode' values.
Source:
Parameters:
Name Type Description
val AccessMode new access mode value.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateGiven(u) → {AccessMode}

Update 'given' value.
Source:
Parameters:
Name Type Description
u string string representation of the changes to apply to access mode.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateMode(u) → {AccessMode}

Update 'mode' value.
Source:
Parameters:
Name Type Description
u string string representation of the changes to apply to access mode.
Returns:
Type:
AccessMode
- this AccessMode.

(static) updateWant(u) → {AccessMode}

Update 'want' value.
Source:
Parameters:
Name Type Description
u string string representation of the changes to apply to access mode.
Returns:
Type:
AccessMode
- this AccessMode.