Application Tags ^v2.7.212
Returns the application tags object from security.application.
Application Tags Object
Methods
list()Returns an array of ElementTag objects and ScreenTag objects in the application.
list(includeAccessEntries)includeAccessEntries(boolean): Iftrue, includes access entries in the returned objects.
exists(tagNameOrId)Returns
trueif a tag exists in the application, otherwisefalse.tagNameOrId(string): The tag name or id.
get(tagNameOrId)Returns an ElementTag object, ScreenTag object, or
nullfrom the application.tagNameOrId(string): The tag name or id.
remove(tagNameOrId)Removes a tag from the application and returns
trueif it was removed, otherwisefalse.tagNameOrId(string): The tag name or id.
removeAll()Removes all tags from the application.
createElement(name, dimensionId, hierarchyId)Creates and returns an ElementTag object in the application.
name(string): The tag name.dimensionId(string): The dimension id.hierarchyId(string): The hierarchy id.
createScreen(name)Creates and returns a ScreenTag object in the application.
name(string): The tag name.
User Helpers
These methods are also available on the tags object so user tag operations can be performed from the application context.
userRemoveAll(userIdOrUser)Removes all tags from a user in the application.
userIdOrUser(string | object): The user id or User object.
userSetTags(userIdOrUser, tags)Replaces the user's application tags.
userIdOrUser(string | object): The user id or User object.tags(array): An array of tag names, ids, or tag objects.
userGetTags(userIdOrUser)Returns an array of all ElementTag and ScreenTag objects assigned to a user in the application.
userIdOrUser(string | object): The user id or User object.
userGetElements(userIdOrUser, dimension, hierarchy)Returns the accessible elements for a user in a hierarchy.
userIdOrUser(string | object): The user id or User object.dimension(string): The dimension name or id.hierarchy(string): The hierarchy name or id.
userGetScreenTags(userIdOrUser)Returns an array of all ScreenTag objects assigned to a user in the application.
userIdOrUser(string | object): The user id or User object.
userGetElementTags(userIdOrUser)Returns an array of all ElementTag objects assigned to a user in the application.
userIdOrUser(string | object): The user id or User object.
Examples
js
var app = security.application("My Application");
var tags = app.tags;
var regionTag = tags.createElement("Region Access", "Account", "Default");
var screenTag = tags.createScreen("Planner Screens");
console.log(tags.exists("Region Access"));
console.log(tags.list());
tags.userSetTags("user@example.com", [regionTag, screenTag]);