CWTPortalUtil Class
Class to assist with portal management
Constructor
CWTPortalUtil
-
sp_portal
Parameters:
-
sp_portal
GlideRecord | StringReference to the Service Portal or the SysID of the portal to use.
Item Index
Methods
- copy
- copyRecord
- hasAccess
- hasAccessTo
- hasPortalAccess
- isFalse static
- isFalse static
Methods
copy
-
source
-
[values]
Copy a portal.
Additionally copies the Theme and Homepage as they tend to need to be unique for the new Portal.
Parameters:
-
source
GlideRecord -
[values]
Object optionalOptional object mapping properties to new values to use on the copy.
Returns:
New GlideRecord pointing to the newly created copy.
copyRecord
-
source
-
[keysAppend]
-
[keysIgnore]
Creates a "surface" level copy of the passed object.
Any child relationships from the source record are not copied, their references are merely repeated in the created copy.
Parameters:
-
source
GlideRecord -
[keysAppend]
Array optionalOptional array of property names to which " - Copy" should be added. The keys "Title" (records), "Name" (records), and "ID" (widgets) are always considered append keys. This applies to "u_title", "u_name", and "u_id" as well.
-
[keysIgnore]
Array optionalOptional array of property names to ignore when copying. sys_id is always automatically ignored for this process.
Returns:
New GlideRecord pointing to the newly created copy.
hasAccess
-
[sys_id]
Parameters:
-
[sys_id]
String optionalOptional SysID of the user to check for access to the current portal. Defaults to the current user.
Returns:
True if the user is directly listed as a content creator, false otherwise.
hasAccessTo
-
portal_id
-
[admin_roles]
-
[user_id]
Parameters:
-
portal_id
GlideRecord | StringIndicates the Portal to be considered for access.
-
[admin_roles]
Array optionalOptional array of Role SysIDs that should be considered for administrative override.
-
[user_id]
GlideRecord | String optionalOptional indicator for the User to be considered for access. Defaults to the sessions current User.
Returns:
True if the user has access, false otherwise.
hasPortalAccess
-
record
-
[admin_roles]
-
[user_id]
Checks access to a portal against the portal's Content Creator's list.
This method handles checking the parental relationship of the passed object and will navigate any needed relationship lookups to find the related portal.
Parameters:
-
record
GlideRecord -
[admin_roles]
Array optionalOptional array of Role SysIDs that should be considered for administrative override.
-
[user_id]
GlideRecord | String optionalOptional indicator for the User to be considered for access. Defaults to the sessions current User.
Returns:
True if the user has access, false otherwise.
isFalse
-
value
Determine if a value should be considered true.
Due to a variety of ways of true/false values being returned by service now, this method exists to level set to a JavaScript boolean value for use.
Returns:
True if the value is considered as trying to be "true", false otherwise.
isFalse
-
value
Determine if a value should be considered false.
Due to a variety of ways of true/false values being returned by service now, this method exists to level set to a JavaScript boolean value for use.
Returns:
True if the value is considered as trying to be "false", false otherwise.