Screen Tag ^v2.7.212
Returns a ScreenTag object from the application tags object.
Screen Tag Object
Methods
name()Returns the tag name as a string.
type()Returns
"screen".users()Returns an array of User objects assigned to this tag.
access()Returns an object containing the screen access entries assigned to this tag.
addUser(userIdOrUserOrEmail)Assigns a user to this tag and returns
trueif the user was added, otherwisefalse.userIdOrUserOrEmail(number | string | object): The user id, email address, or User object.
removeUser(userIdOrUserOrEmail)Removes a user from this tag and returns
trueif the user was removed, otherwisefalse.userIdOrUserOrEmail(number | string | object): The user id, email address, or User object.
hasUser(userIdOrUserOrEmail)Returns
trueif a user is assigned to this tag, otherwisefalse.userIdOrUserOrEmail(number | string | object): The user id, email address, or User object.
set(screenIdOrTitle, visible)Sets visibility for a screen on this tag and returns
trueif the screen entry was set, otherwisefalse.screenIdOrTitle(string): The screen id or title.visible(boolean): Whether the screen is visible.
clear()Removes all screen visibility entries from this tag.
json()Returns the tag as an object.
json(includeAccessEntries)Returns the tag as an object and optionally includes access entries.
includeAccessEntries(boolean): Iftrue, includes access entries in the returned object.
Examples
js
var app = security.application("My Application");
var tag = app.tags.createScreen("Planner Screens");
tag.set("Planner", true);
tag.addUser("user@example.com");
console.log(tag.access());
console.log(tag.json(true));