Child pages
  • Security

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:id=|class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{td}{tr}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#ACCESSIBLE]
Constant representing the accessible flag for form security.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#DELETE]
Constant representing the delete flag for table security.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#INSERT]
Constant representing the insert flag for table security.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#READ]
Constant representing the read flag for table security.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#TRACKING]
Constant representing the tracking flag for table security (tracks sql insert/update/delete).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#TRACKING_VIEWS]
Constant representing the tracking flag for table security (tracks sql select).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#UPDATE]
Constant representing the update flag for table security.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#VIEWABLE]
Constant representing the viewable flag for form security.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#addUserToGroup]\(a_userUID, groupName)
Adds an user to a named group.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#authenticate]\(authenticator_solution, method)
Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#authenticate]\(authenticator_solution, method, credentials)
Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#canDelete]\(dataSource)
Returns a boolean value for security rights.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#canInsert]\(dataSource)
Returns a boolean value for security rights.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#canRead]\(dataSource)
Returns a boolean value for security rights.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#canUpdate]\(dataSource)
Returns a boolean value for security rights.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#changeGroupName]\(oldGroupName, newGroupName)
Changes the groupname of a group.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#changeUserName]\(a_userUID, username)
Changes the username of the specified userUID.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#checkPassword]\(a_userUID, password)
Returns true if the password for that userUID is correct, else false.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#createGroup]\(groupName)
Creates a group, returns the groupname (or null when group couldn't be created).{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#createUser]\(username, password)
Creates a new user, returns new uid (or null when group couldn't be created or user alreay \[userUID\]exist).{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#createUser]\(username, password, userUID)
Creates a new user, returns new uid (or null when group couldn't be created or user alreay exist).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteGroup]\(groupName)
Deletes a group, returns true if no error was reported.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteUser]\(userUID)
Deletes an user.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getClientID]\()
Returns the client ID.{td}{tr}{tbody}{tbody}{tr}{td}[JSDataSet]{td}{td}[#getElementUUIDs]\(formname)
Returns the form elements UUID's as dataset, the one with no name is the form itself.{td}{tr}{tbody}{tbody}{tr}{td}[JSDataSet]{td}{td}[#getGroups]\()
Get all the groups (returns a dataset).{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getSystemUserName]\()
Retrieves the username of the currently logged in user on operating system level.{td}{tr}{tbody}{tbody}{tr}{td}[JSDataSet]{td}{td}[#getUserGroups]\()
Get all the groups of the current user.{td}{tr}{tbody}{tbody}{tr}{td}[JSDataSet]{td}{td}[#getUserGroups]\(userUID)
Get all the groups for given user UID.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getUserName]\(\[userUID\])
Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getUserUID#getUserName]\(\[username\]userUID)
Get the current user UIDname (null if not logged in), finds the user userUIDname for given user\_name UID if passed as parameter.{td}{tr}{tbody}{tbody}{tr}{td}[JSDataSetString]{td}{td}[#getUsers#getUserUID]\(\[groupName\])
Get all the userscurrent inuser theUID security(null settingsif (returnsnot alogged dataset).in); finds the userUID for given user\_name if passed as parameter.{td}{tr}{tbody}{tbody}{tr}{td}[BooleanString]{td}{td}[#isUserMemberOfGroup#getUserUID]\(groupNameusername)
CheckGet whatever the current user is part of the specified group UID (null if not logged in); finds the userUID for given user\_name if passed as parameter.{td}{tr}{tbody}{tbody}{tr}{td}[BooleanJSDataSet]{td}{td}[#isUserMemberOfGroup#getUsers]\(groupName, userUID)
CheckGet whateverall the userusers specifiedin asthe parametersecurity issettings part(returns of the specified groupa dataset).{td}{tr}{tbody}{tbody}{tr}{td}[BooleanJSDataSet]{td}{td}[#login#getUsers]\(display_username, a_userUID, groups)
Login to be able to leave the solution loginFormgroupName)
Get all the users in the security settings (returns a dataset).{td}{tr}{tbody}{tbody}{tr}{td}void[Boolean]{td}{td}[#logout#isUserMemberOfGroup]\(\[solutionToLoad\], \[method\], \[argument\])
LogoutgroupName)
Check whatever the current user andis closepart theof solution, if the solution requires authentication and user is logged in.specified group{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeUserFromGroup#isUserMemberOfGroup]\(a_userUIDgroupName, groupNameuserUID)
Check Removeswhatever anthe user from a specified as parameter is part of the specified group.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setPassword#login]\(username, a_userUID, passwordgroups)
SetLogin to abe newable passwordto forleave the givensolution userUIDloginForm.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setSecuritySettings#logout]\(dataset)
SetsLogout the securitycurrent settings;user the entries contained inand close the givensolution, datasetif willthe overridesolution thoserequires containedauthentication inand theuser currentis securitylogged settingsin.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]void{td}{td}[#setUserUID#logout]\(a_userUID, newUserUID)
Set a new userUID for the given userUIDsolutionToLoad)
Logout the current user and close the solution, if the solution requires authentication and user is logged in.{td}{tr}{tbody}{tabletbody}\\ 

{table:id=constant|class=servoy sDetail{tr}{colgrouptd}{column:padding=0px|width=100%void{td}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=ACCESSIBLE|class=node}{tr:id=name}{td}h6.ACCESSIBLE{td}{tr}{tr:id=des}{td}{sub-section:ACCESSIBLE_des|text=|trigger=button}{sub-section}{sub-section:ACCESSIBLE_des|trigger=none|class=sIndent}Constant representing the accessible flag for form security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:ACCESSIBLE_snc|text=|trigger=button}{sub-section}{sub-section:ACCESSIBLE_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:ACCESSIBLE_prs|text=|trigger=button}{sub-section}{sub-section:ACCESSIBLE_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:ACCESSIBLE_rettd}[#logout]\(solutionToLoad, method)
Logout the current user and close the solution, if the solution requires authentication and user is logged in.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#logout]\(solutionToLoad, method, argument)
Logout the current user and close the solution, if the solution requires authentication and user is logged in.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeUserFromGroup]\(a_userUID, groupName)
Removes an user from a group.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setPassword]\(a_userUID, password)
Set a new password for the given userUID.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setSecuritySettings]\(dataset)
Sets the security settings; the entries contained in the given dataset will override those contained in the current security settings.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setUserUID]\(a_userUID, newUserUID)
Set a new userUID for the given userUID.{td}{tr}{tbody}{table}\\ 

{table:id=constant|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=ACCESSIBLE|class=node}{tr:id=name}{td}h6.ACCESSIBLE{td}{tr}{tr:id=des}{td}{sub-section:ACCESSIBLE_des|text=|trigger=button}{sub-section}{sub-section:ACCESSIBLE_retdes|trigger=none|class=sIndent}[Number]Constant representing the accessible flag for form security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=seesnc}{td}*Also seeSince*\\{sub-section:ACCESSIBLE_seesnc|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:ACCESSIBLE_seesnc|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:ACCESSIBLE_linkprs|text=|trigger=button}{sub-section}{div:sub-section:ACCESSIBLE_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:ACCESSIBLE_linkret|text=|trigger=nonebutton}{sub-section}{sub-section:ACCESSIBLE_ret|trigger=none|class=sIndent}{div[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=samsee}{td}*SampleAlso see*\\{sub-section:ACCESSIBLE_samsee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:ACCESSIBLE_samsee|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:ACCESSIBLE_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:ACCESSIBLE_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:ACCESSIBLE_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:ACCESSIBLE_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DELETE|class=node}{tr:id=name}{td}h6.DELETE{td}{tr}{tr:id=des}{td}{sub-section:DELETE_des|text=|trigger=button}{sub-section}{sub-section:DELETE_des|trigger=none|class=sIndent}Constant representing the delete flag for table security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:DELETE_snc|text=|trigger=button}{sub-section}{sub-section:DELETE_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:DELETE_prs|text=|trigger=button}{sub-section}{sub-section:DELETE_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:DELETE_ret|text=|trigger=button}{sub-section}{sub-section:DELETE_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DELETE_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DELETE_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DELETE_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DELETE_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DELETE_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DELETE_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=INSERT|class=node}{tr:id=name}{td}h6.INSERT{td}{tr}{tr:id=des}{td}{sub-section:INSERT_des|text=|trigger=button}{sub-section}{sub-section:INSERT_des|trigger=none|class=sIndent}Constant representing the insert flag for table security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:INSERT_snc|text=|trigger=button}{sub-section}{sub-section:INSERT_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:INSERT_prs|text=|trigger=button}{sub-section}{sub-section:INSERT_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:INSERT_ret|text=|trigger=button}{sub-section}{sub-section:INSERT_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:INSERT_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INSERT_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:INSERT_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INSERT_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:INSERT_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INSERT_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=READ|class=node}{tr:id=name}{td}h6.READ{td}{tr}{tr:id=des}{td}{sub-section:READ_des|text=|trigger=button}{sub-section}{sub-section:READ_des|trigger=none|class=sIndent}Constant representing the read flag for table security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:READ_snc|text=|trigger=button}{sub-section}{sub-section:READ_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:READ_prs|text=|trigger=button}{sub-section}{sub-section:READ_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:READ_ret|text=|trigger=button}{sub-section}{sub-section:READ_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:READ_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:READ_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:READ_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:READ_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:READ_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:READ_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=TRACKING|class=node}{tr:id=name}{td}h6.TRACKING{td}{tr}{tr:id=des}{td}{sub-section:TRACKING_des|text=|trigger=button}{sub-section}{sub-section:TRACKING_des|trigger=none|class=sIndent}Constant representing the tracking flag for table security (tracks sql insert/update/delete).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:TRACKING_snc|text=|trigger=button}{sub-section}{sub-section:TRACKING_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:TRACKING_prs|text=|trigger=button}{sub-section}{sub-section:TRACKING_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:TRACKING_ret|text=|trigger=button}{sub-section}{sub-section:TRACKING_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:TRACKING_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:TRACKING_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:TRACKING_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:TRACKING_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:TRACKING_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:TRACKING_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=UPDATETRACKING_VIEWS|class=node}{tr:id=name}{td}h6.UPDATETRACKING_VIEWS{td}{tr}{tr:id=des}{td}{sub-section:UPDATETRACKING_VIEWS_des|text=|trigger=button}{sub-section}{sub-section:UPDATETRACKING_VIEWS_des|trigger=none|class=sIndent}Constant representing the updatetracking flag for table security (tracks sql select).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:UPDATETRACKING_VIEWS_snc|text=|trigger=button}{sub-section}{sub-section:UPDATETRACKING_VIEWS_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:UPDATETRACKING_VIEWS_prs|text=|trigger=button}{sub-section}{sub-section:UPDATETRACKING_VIEWS_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:UPDATETRACKING_VIEWS_ret|text=|trigger=button}{sub-section}{sub-section:UPDATETRACKING_VIEWS_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:UPDATETRACKING_VIEWS_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:UPDATETRACKING_VIEWS_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:UPDATETRACKING_VIEWS_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:UPDATETRACKING_VIEWS_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:UPDATETRACKING_VIEWS_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:UPDATETRACKING_VIEWS_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=VIEWABLEUPDATE|class=node}{tr:id=name}{td}h6.VIEWABLEUPDATE{td}{tr}{tr:id=des}{td}{sub-section:VIEWABLEUPDATE_des|text=|trigger=button}{sub-section}{sub-section:VIEWABLEUPDATE_des|trigger=none|class=sIndent}Constant representing the viewableupdate flag for formtable security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:VIEWABLEUPDATE_snc|text=|trigger=button}{sub-section}{sub-section:VIEWABLEUPDATE_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:VIEWABLEUPDATE_prs|text=|trigger=button}{sub-section}{sub-section:VIEWABLEUPDATE_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:VIEWABLEUPDATE_ret|text=|trigger=button}{sub-section}{sub-section:VIEWABLEUPDATE_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:VIEWABLEUPDATE_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:VIEWABLEUPDATE_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:VIEWABLEUPDATE_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:VIEWABLEUPDATE_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:VIEWABLEUPDATE_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:VIEWABLEUPDATE_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{tabletbody:id=functionVIEWABLE|class=servoy sDetailnode}{colgrouptr:id=name}{column:padding=0px|width=100%}{column}{colgrouptd}h6.VIEWABLE{td}{tr}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addUserToGroup|class=node}{tr:id=name}{td}h6.addUserToGroup{td}{trid=des}{td}{sub-section:VIEWABLE_des|text=|trigger=button}{sub-section}{sub-section:VIEWABLE_des|trigger=none|class=sIndent}Constant representing the viewable flag for form security.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sigsnc}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}addUserToGroup{span}{span:id=iets|style=float: left;}\(a_userUID, groupName){span}{td}{tr*Since*\\{sub-section:VIEWABLE_snc|text=|trigger=button}{sub-section}{sub-section:VIEWABLE_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=desprs}{td}*Parameters*\\{sub-section:addUserToGroupVIEWABLE_desprs|text=|trigger=button}{sub-section}{sub-section:addUserToGroupVIEWABLE_desprs|trigger=none|class=sIndent}Adds an user to a named group.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sncret}{td}*SinceReturns*\\{sub-section:addUserToGroupVIEWABLE_sncret|text=|trigger=button}{sub-section}{sub-section:addUserToGroupVIEWABLE_sncret|trigger=none|class=sIndent} Replace with version info[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prssee}{td}*ParametersAlso see*\\{sub-section:addUserToGroupVIEWABLE_prssee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addUserToGroupVIEWABLE_prssee|trigger=none|class=sIndent}\{[Object]} a_userUID -- the user UID to be added
\{[Object]} groupName -- the group to add to
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addUserToGroup_ret|text=|trigger=button}{sub-section}{sub-section:addUserToGroup_ret|trigger=none|class=sIndent}[Boolean] -- true if added{sub-section}{td}{tr}{builder-show:}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=seelink}{td}*AlsoExternal seelinks*\\{sub-section:addUserToGroupVIEWABLE_seelink|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addUserToGroupVIEWABLE_seelink|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linksam}{td}*External linksSample*\\{sub-section:addUserToGroupVIEWABLE_linksam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addUserToGroupVIEWABLE_linksam|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addUserToGroup_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addUserToGroup_sam|trigger=none}{code:language=javascript}
var userUID = security.getUserUID();
security.addUserToGroup(userUID, 'groupname');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=authenticate-String_Stringcode:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addUserToGroup|class=node}{tr:id=name}{td}h6.authenticateaddUserToGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[ObjectBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}authenticateaddUserToGroup{span}{span:id=iets|style=float: left;}\(authenticatora_solutionuserUID, methodgroupName){span}{td}{tr}{tr:id=des}{td}{sub-section:authenticate-String_StringaddUserToGroup_des|text=|trigger=button}{sub-section}{sub-section:authenticate-StringaddUserToGroup_String_des|trigger=none|class=sIndent}AuthenticateAdds toan the Servoy Server using one of the installed authenticators or the Servoy default authenticator.

Note: this method should be called from a login solutionuser to a named group.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:authenticate-StringaddUserToGroup_String_snc|text=|trigger=button}{sub-section}{sub-section:authenticate-StringaddUserToGroup_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:authenticate-StringaddUserToGroup_String_prs|text=|trigger=button}{sub-section}{sub-section:authenticate-String_StringaddUserToGroup_prs|trigger=none|class=sIndent}\{[StringObject]} authenticatora_solutionuserUID -- authenticator solution installed on the Servoyuser Server,UID nullto for servoy built\-in authenticationbe added
\{[StringObject]} methodgroupName -- authenticatorthe method,group nullto foradd servoy built\-in authentication
to
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:authenticate-String_StringaddUserToGroup_ret|text=|trigger=button}{sub-section}{sub-section:authenticate-StringaddUserToGroup_String_ret|trigger=none|class=sIndent}[ObjectBoolean] -- authenticationtrue result from authenticator solution or boolean in case of servoy built-in authenticationif added{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:authenticate-String_StringaddUserToGroup_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:authenticate-StringaddUserToGroup_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:authenticate-StringaddUserToGroup_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:authenticate-String_StringaddUserToGroup_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:authenticate-StringaddUserToGroup_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:authenticate-String_StringaddUserToGroup_sam|trigger=none}{code:language=javascript}
// create the credentials object as expected by the
authenticator solution
var okuserUID =  security.authenticate('myldap_authenticator', 'login', [globals.userName, globals.passWord])
if (!ok)
{
	plugins.dialogs.showErrorDialog('Login failed', 'OK')
}
	
// if no authenticator name is used, the credentials are checked using the Servoy built-in user management
ok = security.authenticate(null, null, [globals.userName, globals.passWord])
getUserUID();
security.addUserToGroup(userUID, 'groupname');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=authenticate-String_String_|class=node}{tr:id=name}{td}h6.authenticate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}authenticate{span}{span:id=iets|style=float: left;}\(authenticator_solution, method, credentials){span}{td}{tr}{tr:id=des}{td}{sub-section:authenticate-String_String__des|text=|trigger=button}{sub-section}{sub-section:authenticate-String_String__des|trigger=none|class=sIndent}Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.

Note: this method should be called from a login solution, once logged in, the authenticate method has no effect.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:authenticate-String_String__snc|text=|trigger=button}{sub-section}{sub-section:authenticate-String_String__snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:authenticate-String_String__prs|text=|trigger=button}{sub-section}{sub-section:authenticate-String_String__prs|trigger=none|class=sIndent}\{[String]} authenticator_solution -- authenticator solution installed on the Servoy Server, null for servoy built\-in authentication
\{[String]} method -- authenticator method, null for servoy built\-in authentication
\{[Object]\[]} credentials -- array whose elements are passed as arguments to the authenticator method, in case of servoy built\-in authentication this should be \[username, password\]
{sub-section}{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:authenticate-String_String__ret|text=|trigger=button}{sub-section}{sub-section:authenticate-String_String__ret|trigger=none|class=sIndent}[Object] -- authentication result from authenticator solution or boolean in case of servoy built-in authentication{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:authenticate-String_String__see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:authenticate-String_String__see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:authenticate-String_String__link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:authenticate-String_String__link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:authenticate-String_String__sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:authenticate-String_String__sam|trigger=none}{code:language=javascript}
// create the credentials object as expected by the authenticator solution
var ok =  security.authenticate('myldap_authenticator', 'login', [scopes.globals.userName, scopes.globals.passWord])
if (!ok)
{
	plugins.dialogs.showErrorDialog('Login failed', 'OK')
}

// if no authenticator name is used, the credentials are checked using the Servoy built-in user management
ok = security.authenticate(null, null, [scopes.globals.userName, scopes.globals.passWord])
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=canDeleteauthenticate-String_String_ObjectArray|class=node}{tr:id=name}{td}h6.canDeleteauthenticate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[BooleanObject]{span}{span:id=iets|style=float: left; font-weight: bold;}canDeleteauthenticate{span}{span:id=iets|style=float: left;}\(dataSourceauthenticator_solution, method, credentials){span}{td}{tr}{tr:id=des}{td}{sub-section:canDeleteauthenticate-String_String_ObjectArray_des|text=|trigger=button}{sub-section}{sub-section:canDeleteauthenticate-String_String_ObjectArray_des|trigger=none|class=sIndent}Returns a boolean value for security rightsAuthenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.

Note: this method should be called from a login solution, once logged in, the authenticate method has no effect.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:canDeleteauthenticate-String_String_ObjectArray_snc|text=|trigger=button}{sub-section}{sub-section:canDeleteauthenticate-String_String_ObjectArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:canDeleteauthenticate-String_String_ObjectArray_prs|text=|trigger=button}{sub-section}{sub-section:canDeleteauthenticate-String_String_ObjectArray_prs|trigger=none|class=sIndent}\{[String]} dataSource -- the datasource authenticator_solution -- authenticator solution installed on the Servoy Server, null for servoy built\-in authentication
\{[String]} method -- authenticator method, null for servoy built\-in authentication
\{[Object]\[]} credentials -- array whose elements are passed as arguments to the authenticator method, in case of servoy built\-in authentication this should be \[username, password\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:canDeleteauthenticate-String_String_ObjectArray_ret|text=|trigger=button}{sub-section}{sub-section:canDeleteauthenticate-String_String_ObjectArray_ret|trigger=none|class=sIndent}[BooleanObject] -- true if allowed authentication result from authenticator solution or boolean in case of servoy built-in authentication{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:canDeleteauthenticate-String_String_ObjectArray_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canDeleteauthenticate-String_String_ObjectArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:canDeleteauthenticate-String_String_ObjectArray_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canDeleteauthenticate-String_String_ObjectArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:canDeleteauthenticate-String_String_ObjectArray_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canDeleteauthenticate-String_String_ObjectArray_sam|trigger=none}{code:language=javascript}
var dataSource = controller.getDataSource();
var canDelete = security.canDelete(dataSource);
var canInsert = security.canInsert(dataSource);
var canUpdate = security.canUpdate(dataSource);
var canRead = security.canRead(dataSource);
application.output("Can delete? " + canDelete);
application.output("Can insert? " + canInsert);
application.output("Can update? " + canUpdate);
application.output("Can read? " + canRead);
// create the credentials object as expected by the authenticator solution
var ok =  security.authenticate('myldap_authenticator', 'login', [scopes.globals.userName, scopes.globals.passWord])
if (!ok)
{
	plugins.dialogs.showErrorDialog('Login failed', 'OK')
}

// if no authenticator name is used, the credentials are checked using the Servoy built-in user management
ok = security.authenticate(null, null, [scopes.globals.userName, scopes.globals.passWord])
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=canInsertcanDelete-String|class=node}{tr:id=name}{td}h6.canInsertcanDelete{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}canInsertcanDelete{span}{span:id=iets|style=float: left;}\(dataSource){span}{td}{tr}{tr:id=des}{td}{sub-section:canInsertcanDelete-String_des|text=|trigger=button}{sub-section}{sub-section:canInsertcanDelete-String_des|trigger=none|class=sIndent}Returns a boolean value for security rights.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:canInsertcanDelete-String_snc|text=|trigger=button}{sub-section}{sub-section:canInsertcanDelete-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:canInsertcanDelete-String_prs|text=|trigger=button}{sub-section}{sub-section:canInsertcanDelete-String_prs|trigger=none|class=sIndent}\{[String]} dataSource -- the datasource
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:canInsertcanDelete-String_ret|text=|trigger=button}{sub-section}{sub-section:canInsertcanDelete-String_ret|trigger=none|class=sIndent}[Boolean] -- true if allowed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:canInsertcanDelete-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canInsertcanDelete-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:canInsertcanDelete-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canInsertcanDelete-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:canInsertcanDelete-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canInsertcanDelete-String_sam|trigger=none}{code:language=javascript}
var dataSource = controller.getDataSource();
var canDelete = security.canDelete(dataSource);
var canInsert = security.canInsert(dataSource);
var canUpdate = security.canUpdate(dataSource);
var canRead = security.canRead(dataSource);
application.output("Can delete? " + canDelete);
application.output("Can insert? " + canInsert);
application.output("Can update? " + canUpdate);
application.output("Can read? " + canRead);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=canReadcanInsert-String|class=node}{tr:id=name}{td}h6.canReadcanInsert{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}canReadcanInsert{span}{span:id=iets|style=float: left;}\(dataSource){span}{td}{tr}{tr:id=des}{td}{sub-section:canReadcanInsert-String_des|text=|trigger=button}{sub-section}{sub-section:canReadcanInsert-String_des|trigger=none|class=sIndent}Returns a boolean value for security rights.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:canReadcanInsert-String_snc|text=|trigger=button}{sub-section}{sub-section:canReadcanInsert-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:canReadcanInsert-String_prs|text=|trigger=button}{sub-section}{sub-section:canReadcanInsert-String_prs|trigger=none|class=sIndent}\{[String]} dataSource -- the datasource
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:canReadcanInsert-String_ret|text=|trigger=button}{sub-section}{sub-section:canReadcanInsert-String_ret|trigger=none|class=sIndent}[Boolean] -- true if allowed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:canReadcanInsert-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canReadcanInsert-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:canReadcanInsert-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canReadcanInsert-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:canReadcanInsert-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canReadcanInsert-String_sam|trigger=none}{code:language=javascript}
var dataSource = controller.getDataSource();
var canDelete = security.canDelete(dataSource);
var canInsert = security.canInsert(dataSource);
var canUpdate = security.canUpdate(dataSource);
var canRead = security.canRead(dataSource);
application.output("Can delete? " + canDelete);
application.output("Can insert? " + canInsert);
application.output("Can update? " + canUpdate);
application.output("Can read? " + canRead);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=canUpdatecanRead-String|class=node}{tr:id=name}{td}h6.canUpdatecanRead{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}canUpdatecanRead{span}{span:id=iets|style=float: left;}\(dataSource){span}{td}{tr}{tr:id=des}{td}{sub-section:canUpdatecanRead-String_des|text=|trigger=button}{sub-section}{sub-section:canUpdatecanRead-String_des|trigger=none|class=sIndent}Returns a boolean value for security rights.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:canUpdatecanRead-String_snc|text=|trigger=button}{sub-section}{sub-section:canUpdatecanRead-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:canUpdatecanRead-String_prs|text=|trigger=button}{sub-section}{sub-section:canUpdatecanRead-String_prs|trigger=none|class=sIndent}\{[String]} dataSource -- the datasource
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:canUpdatecanRead-String_ret|text=|trigger=button}{sub-section}{sub-section:canUpdatecanRead-String_ret|trigger=none|class=sIndent}[Boolean] -- true if allowed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:canUpdatecanRead-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canUpdatecanRead-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:canUpdatecanRead-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canUpdatecanRead-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:canUpdatecanRead-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:canUpdatecanRead-String_sam|trigger=none}{code:language=javascript}
var dataSource = controller.getDataSource();
var canDelete = security.canDelete(dataSource);
var canInsert = security.canInsert(dataSource);
var canUpdate = security.canUpdate(dataSource);
var canRead = security.canRead(dataSource);
application.output("Can delete? " + canDelete);
application.output("Can insert? " + canInsert);
application.output("Can update? " + canUpdate);
application.output("Can read? " + canRead);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=changeGroupNamecanUpdate-String|class=node}{tr:id=name}{td}h6.changeGroupNamecanUpdate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}changeGroupNamecanUpdate{span}{span:id=iets|style=float: left;}\(oldGroupName, newGroupNamedataSource){span}{td}{tr}{tr:id=des}{td}{sub-section:changeGroupNamecanUpdate-String_des|text=|trigger=button}{sub-section}{sub-section:changeGroupNamecanUpdate-String_des|trigger=none|class=sIndent}ChangesReturns a theboolean groupnamevalue offor asecurity grouprights.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:changeGroupNamecanUpdate-String_snc|text=|trigger=button}{sub-section}{sub-section:changeGroupNamecanUpdate-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:changeGroupNamecanUpdate-String_prs|text=|trigger=button}{sub-section}{sub-section:changeGroupNamecanUpdate-String_prs|trigger=none|class=sIndent}\{[Object]} oldGroupName -- the old name
\{[String]} newGroupNamedataSource -- the new namedatasource
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:changeGroupNamecanUpdate-String_ret|text=|trigger=button}{sub-section}{sub-section:changeGroupNamecanUpdate-String_ret|trigger=none|class=sIndent}[Boolean] -- true if changedallowed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:changeGroupNamecanUpdate-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:changeGroupNamecanUpdate-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:changeGroupNamecanUpdate-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:changeGroupNamecanUpdate-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:changeGroupNamecanUpdate-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:changeGroupNamecanUpdate-String_sam|trigger=none}{code:language=javascript}
var dataSource = controller.getDataSource();
var canDelete = security.changeGroupName('oldGroup', 'newGroup');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{canDelete(dataSource);
var canInsert = security.canInsert(dataSource);
var canUpdate = security.canUpdate(dataSource);
var canRead = security.canRead(dataSource);
application.output("Can delete? " + canDelete);
application.output("Can insert? " + canInsert);
application.output("Can update? " + canUpdate);
application.output("Can read? " + canRead);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=changeUserNamechangeGroupName|class=node}{tr:id=name}{td}h6.changeUserNamechangeGroupName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}changeUserNamechangeGroupName{span}{span:id=iets|style=float: left;}\(a_userUIDoldGroupName, usernamenewGroupName){span}{td}{tr}{tr:id=des}{td}{sub-section:changeUserNamechangeGroupName_des|text=|trigger=button}{sub-section}{sub-section:changeUserNamechangeGroupName_des|trigger=none|class=sIndent}Changes the usernamegroupname of thea specified userUIDgroup.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:changeUserNamechangeGroupName_snc|text=|trigger=button}{sub-section}{sub-section:changeUserNamechangeGroupName_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:changeUserNamechangeGroupName_prs|text=|trigger=button}{sub-section}{sub-section:changeUserNamechangeGroupName_prs|trigger=none|class=sIndent}\{[Object]} a_userUIDoldGroupName -- the userUIDold to workname
on
\{[String]} usernamenewGroupName -- the new usernamename
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:changeUserNamechangeGroupName_ret|text=|trigger=button}{sub-section}{sub-section:changeUserNamechangeGroupName_ret|trigger=none|class=sIndent}[Boolean] -- true if changed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:changeUserNamechangeGroupName_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:changeUserNamechangeGroupName_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:changeUserNamechangeGroupName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:changeUserNamechangeGroupName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:changeUserNamechangeGroupName_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:changeUserNamechangeGroupName_sam|trigger=none}{code:language=javascript}
if(security.changeUserNamechangeGroupName(security.getUserUID('name1oldGroup'), 'name2newGroup'));
{
	application.output('Username changed');
}
{code}{sub-section}{{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=checkPasswordchangeUserName|class=node}{tr:id=name}{td}h6.checkPasswordchangeUserName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}checkPasswordchangeUserName{span}{span:id=iets|style=float: left;}\(a_userUID, passwordusername){span}{td}{tr}{tr:id=des}{td}{sub-section:checkPasswordchangeUserName_des|text=|trigger=button}{sub-section}{sub-section:checkPasswordchangeUserName_des|trigger=none|class=sIndent}ReturnsChanges the trueusername ifof the password forspecified that userUID is correct, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:checkPasswordchangeUserName_snc|text=|trigger=button}{sub-section}{sub-section:checkPasswordchangeUserName_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:checkPasswordchangeUserName_prs|text=|trigger=button}{sub-section}{sub-section:checkPasswordchangeUserName_prs|trigger=none|class=sIndent}\{[Object]} a_userUID -- the userUID to check the password forwork on
\{[String]} passwordusername -- the new passwordusername
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:checkPasswordchangeUserName_ret|text=|trigger=button}{sub-section}{sub-section:checkPasswordchangeUserName_ret|trigger=none|class=sIndent}[Boolean] -- true if password okechanged{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:checkPasswordchangeUserName_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:checkPasswordchangeUserName_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:checkPasswordchangeUserName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:checkPasswordchangeUserName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:checkPasswordchangeUserName_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:checkPasswordchangeUserName_sam|trigger=none}{code:language=javascript}
if(security.checkPasswordchangeUserName(security.getUserUID(), 'password1'))
{
	security.setPassword(security.getUserUID(name1'), 'password2name2'))
}
else
{
	application.output('wrongUsername passwordchanged');
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createGroupcheckPassword|class=node}{tr:id=name}{td}h6.createGroupcheckPassword{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[StringBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}createGroupcheckPassword{span}{span:id=iets|style=float: left;}\(groupNamea_userUID, password){span}{td}{tr}{tr:id=des}{td}{sub-section:createGroupcheckPassword_des|text=|trigger=button}{sub-section}{sub-section:createGroupcheckPassword_des|trigger=none|class=sIndent}CreatesReturns a group, returnstrue if the groupnamepassword (orfor nullthat whenuserUID group couldn't be created)is correct, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createGroupcheckPassword_snc|text=|trigger=button}{sub-section}{sub-section:createGroupcheckPassword_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createGroupcheckPassword_prs|text=|trigger=button}{sub-section}{sub-section:createGroupcheckPassword_prs|trigger=none|class=sIndent}\{[StringObject]} groupNamea_userUID -- the userUID to groupcheck namethe topassword createfor
{sub-\{[String]} password -- the new password
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createGroupcheckPassword_ret|text=|trigger=button}{sub-section}{sub-section:createGroupcheckPassword_ret|trigger=none|class=sIndent}[StringBoolean] -- true theif createdpassword groupnameoke{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createGroupcheckPassword_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createGroupcheckPassword_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:createGroupcheckPassword_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createGroupcheckPassword_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:createGroupcheckPassword_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createGroupcheckPassword_sam|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createUser|class=node}{tr:id=name}{td}h6.createUserif(security.checkPassword(security.getUserUID(), 'password1'))
{
	security.setPassword(security.getUserUID(), 'password2')
}
else
{
	application.output('wrong password')
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createGroup|class=node}{tr:id=name}{td}h6.createGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}createGroup{span}{span:id=iets|style=float: left;}\(groupName){span}{td}{tr}{tr:id=des}{td}{sub-section:createGroup_des|text=|trigger=button}{sub-section}{sub-section:createGroup_des|trigger=none|class=sIndent}Creates a group, returns the groupname (or null when group couldn't be created).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createGroup_snc|text=|trigger=button}{sub-section}{sub-section:createGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createGroup_prs|text=|trigger=button}{sub-section}{sub-section:createGroup_prs|trigger=none|class=sIndent}\{[String]} groupName -- the group name to create
{sub-section}{td}{tr}{tr:id=sigret}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}createUser{span}{span:id=iets|style=float: left;}\(username, password, \[userUID\]){span*Returns*\\{sub-section:createGroup_ret|text=|trigger=button}{sub-section}{sub-section:createGroup_ret|trigger=none|class=sIndent}[String] -- the created groupname{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=dessee}{td}*Also see*\\{sub-section:createUsercreateGroup_dessee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUsercreateGroup_dessee|trigger=none|class=sIndent}Creates a new user, returns new uid (or null when group couldn't be created or user alreay exist).{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snclink}{td}*SinceExternal links*\\{sub-section:createUsercreateGroup_snclink|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUsercreateGroup_snclink|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:createUsercreateGroup_prssam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUsercreateGroup_prssam|trigger=none|class=sIndent}username -- the username
password -- the user password
\[userUID\] -- the userUID to use
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createUser_ret|text=|trigger=button}{sub-section}{sub-section:createUser_ret|trigger=none|class=sIndent}[Object] -- the userUID the created userUID, will be same if provided{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createUser_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUser_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:createUser_link}{code:language=javascript}
var deleteGroup = true;
//ceate a group
var groupName = security.creategroup('myGroup');
if (groupName)
{
	//create a user
	var uid = security.createUser('myusername', 'mypassword');
	if (uid) //test if user was created
	{
		//set a newUID for the user
		var isChanged = security.setUserUID(uid,'myUserUID')
		// add user to group
		security.addUserToGroup(uid, groupName);
		// if not delete group, do delete group
		if (deleteGroup) 
		{
			security.deleteGroup(groupName);
		}
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createUser-String_String|class=node}{tr:id=name}{td}h6.createUser{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}createUser{span}{span:id=iets|style=float: left;}\(username, password){span}{td}{tr}{tr:id=des}{td}{sub-section:createUser-String_String_des|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUser-String_linkString_des|trigger=none|class=sIndent}Creates a new user, returns new uid (or null when group couldn't be created or user alreay exist).{sub-section}{div}{td}{tr}{builder-show:permission=edit}{tr:id=samsnc}{td}*SampleSince*\\{sub-section:createUser-String_samString_snc|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUser-String_samString_snc|trigger=none}{code:language=javascript|class=sIndent} varReplace removeUserwith = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{codeversion info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createUser-String_String_prs|text=|trigger=button}{sub-section}{sub-section:createUser-String_String_prs|trigger=none|class=sIndent}\{[String]} username -- the username
\{[String]} password -- the user password
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:createUser-String_String_ret|text=|trigger=button}{sub-section}{sub-section:createUser-String_String_ret|trigger=none|class=sIndent}[Object] -- the userUID the created userUID, will be same if provided{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:createUser-String_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{td}{tr}{tr:class=lastDetailRowsub-section:createUser-String_String_see|trigger=none}{sub-section}{div}{td}{td}{tr}{tbodybuilder-show}{tbodybuilder-show:id=deleteGroup|class=nodepermission=edit}{tr:id=namelink}{td}h6.deleteGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteGroup{span}{span:id=iets|style=float: left;}\(groupName){span}{td}{tr*External links*\\{sub-section:createUser-String_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:createUser-String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=dessam}{td}*Sample*\\{sub-section:deleteGroup_descreateUser-String_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteGroup_descreateUser-String_String_sam|trigger=none|class=sIndent}Deletes a group, returns true if no error was reported.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:deleteGroup_snc|text=|trigger=button}{sub-section}{sub-section:deleteGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:deleteGroup_prs|text=|trigger=button}{sub-section}{sub-section:deleteGroup_prs|trigger=none|class=sIndent}\{[Object]} groupName -- the name of the group to delete
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:deleteGroup_ret|text=|trigger=button}{sub-section}{sub-section:deleteGroup_ret|trigger=none|class=sIndent}[Boolean] -- true if deleted{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:deleteGroup_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteGroup_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:deleteGroup_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteGroup_link|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{builder-show}{tr:id=samclass=lastDetailRow}{td}{td}*Sample*\\{sub-section:deleteGroup_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteGroup_sam|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{{tr}{tbody}{tbody:id=createUser-String_String_Object|class=node}{tr:id=name}{td}h6.createUser{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}createUser{span}{span:id=iets|style=float: left;}\(username, password, userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:createUser-String_String_Object_des|text=|trigger=button}{sub-section}{sub-section:createUser-String_String_Object_des|trigger=none|class=sIndent}Creates a new user, returns new uid (or null when group couldn't be created or user alreay exist).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:createUser-String_String_Object_snc|text=|trigger=button}{sub-section}{sub-section:createUser-String_String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:createUser-String_String_Object_prs|text=|trigger=button}{sub-section}{sub-section:createUser-String_String_Object_prs|trigger=none|class=sIndent}\{[String]} username -- the username
\{[String]} password -- the user password
\{[Object]} userUID -- the user UID to use
{sub-section}{td}{tr}{tr:classid=lastDetailRowret}{td}{td}{tr}{tbody}{tbody:id=deleteUser|class=node}{tr:id=name}{td}h6.deleteUser{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteUser{span}{span:id=iets|style=float: left;}\(userUID){span}{td}{tr*Returns*\\{sub-section:createUser-String_String_Object_ret|text=|trigger=button}{sub-section}{sub-section:createUser-String_String_Object_ret|trigger=none|class=sIndent}[Object] -- the userUID the created userUID, will be same if provided{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=dessee}{td}*Also see*\\{sub-section:deleteUser_descreateUser-String_String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteUser_descreateUser-String_String_Object_see|trigger=none|class=sIndent}Deletes an user. returns true if no error was reported.{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snclink}{td}*SinceExternal links*\\{sub-section:deleteUser_snc|createUser-String_String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteUser_snccreateUser-String_String_Object_link|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:deleteUser_prscreateUser-String_String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteUser_prscreateUser-String_String_Object_sam|trigger=none|class=sIndent}\{[Object]{code:language=javascript}
userUIDvar --removeUser The= UID of thetrue;
//create a user
var touid be= deleted.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:deleteUser_ret|text=|trigger=button}{sub-section}{sub-section:deleteUser_ret|trigger=none|class=sIndent}[Boolean] -- true if the user is successfully deleted.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:deleteUser_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteUser_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:deleteUser_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteUser_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:deleteUser_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteUser_sam|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1 ; p <p<= set.getMaxRowIndex() ; p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// addremove the user tofrom the group
			security.addUserToGroupremoveUserFromGroup(uid, set.getValue(p,2));
		}
	// if not remove user, remove user from all the groups
	if(!removeUser)}
	else
	{
		// getdelete nowthe alluser (the groupsuser thatwill thatbe usersremoved hasfrom (all if above did go wellthe groups)
		var set =security.getUserGroupsdeleteUser(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getClientID}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=deleteGroup|class=node}{tr:id=name}{td}h6.getClientIDdeleteGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[StringBoolean]{span}{span:id=iets|style=float: left; font-weight: bold;}getClientIDdeleteGroup{span}{span:id=iets|style=float: left;}\(groupName){span}{td}{tr}{tr:id=des}{td}{sub-section:getClientIDdeleteGroup_des|text=|trigger=button}{sub-section}{sub-section:getClientIDdeleteGroup_des|trigger=none|class=sIndent}Returns the client IDDeletes a group, returns true if no error was reported.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getClientIDdeleteGroup_snc|text=|trigger=button}{sub-section}{sub-section:getClientIDdeleteGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getClientIDdeleteGroup_prs|text=|trigger=button}{sub-section}{sub-section:getClientIDdeleteGroup_prs|trigger=none|class=sIndent}\{[Object]} groupName -- the name of the group to delete
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getClientIDdeleteGroup_ret|text=|trigger=button}{sub-section}{sub-section:getClientIDdeleteGroup_ret|trigger=none|class=sIndent}[StringBoolean] -- thetrue clientId as seen on the server admin pageif deleted{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getClientIDdeleteGroup_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientIDdeleteGroup_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getClientIDdeleteGroup_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientIDdeleteGroup_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getClientIDdeleteGroup_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientIDdeleteGroup_sam|trigger=none}{code:language=javascript}
var clientId deleteGroup = true;
//ceate a group
var groupName = security.getClientID()
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getElementUUIDs|class=node}{tr:id=name}{td}h6.getElementUUIDs{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getElementUUIDs{span}{span:id=iets|style=float: left;}\(formname){spancreategroup('myGroup');
if (groupName)
{
	//create a user
	var uid = security.createUser('myusername', 'mypassword');
	if (uid) //test if user was created
	{
		//set a newUID for the user
		var isChanged = security.setUserUID(uid,'myUserUID')
		// add user to group
		security.addUserToGroup(uid, groupName);
		// if not delete group, do delete group
		if (deleteGroup) 
		{
			security.deleteGroup(groupName);
		}
	}
}
{code}{sub-section}{div}{td}{tr}{tr:id=desclass=lastDetailRow}{td}{td}{sub-section:getElementUUIDstr}{tbody}{tbody:id=deleteUser|class=node}{tr:id=name}{td}h6.deleteUser{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteUser{span}{span:id=iets|style=float: left;}\(userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:deleteUser_des|text=|trigger=button}{sub-section}{sub-section:getElementUUIDsdeleteUser_des|trigger=none|class=sIndent}ReturnsDeletes thean formuser. elementsreturns UUID'strue as dataset, the one with if no nameerror is the form itselfwas reported.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getElementUUIDsdeleteUser_snc|text=|trigger=button}{sub-section}{sub-section:getElementUUIDsdeleteUser_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getElementUUIDsdeleteUser_prs|text=|trigger=button}{sub-section}{sub-section:getElementUUIDsdeleteUser_prs|trigger=none|class=sIndent}\{[StringObject]} formnameuserUID -- The UID of the formnameuser to retieve the dataset forbe deleted.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getElementUUIDsdeleteUser_ret|text=|trigger=button}{sub-section}{sub-section:getElementUUIDsdeleteUser_ret|trigger=none|class=sIndent}[JSDataSetBoolean] -- dataset with element infotrue if the user is successfully deleted.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getElementUUIDsdeleteUser_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getElementUUIDsdeleteUser_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getElementUUIDsdeleteUser_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getElementUUIDsdeleteUser_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getElementUUIDsdeleteUser_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getElementUUIDsdeleteUser_sam|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var formElementsUUIDDataSetuid = security.getElementUUIDscreateUser('orders_form'myusername', 'mypassword');
if (uid) {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getGroups|class=node}{tr:id=name}{td}h6.getGroups{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getGroups{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getGroups_des|text=|trigger=button}{sub-section}{sub-section:getGroups_des|trigger=none|class=sIndent}Get all the groups (returns a dataset).
first id column is depricated!, use only the group name column.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getGroups_snc|text=|trigger=button}{sub-section}{sub-section:getGroups_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getGroups_prs|text=|trigger=button}{sub-section}{sub-section:getGroups_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getGroups_ret|text=|trigger=button}{sub-section}{sub-section:getGroups_ret//test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getClientID|class=node}{tr:id=name}{td}h6.getClientID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getClientID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getClientID_des|text=|trigger=button}{sub-section}{sub-section:getClientID_des|trigger=none|class=sIndent}[JSDataSet] -- dataset with all the groupsReturns the client ID.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=seesnc}{td}*Also seeSince*\\{sub-section:getGroupsgetClientID_seesnc|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getGroupsgetClientID_seesnc|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:getGroupsgetClientID_linkprs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getGroupsgetClientID_linkprs|trigger=none|class=sIndent}{sub-section}{div}{td}{tr}{builder-show}{tr:id=samret}{td}*SampleReturns*\\{sub-section:getGroupsgetClientID_samret|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-sub-section:getGroupsgetClientID_samret|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getSystemUserName|class=node}{tr:id=name}{td}h6.getSystemUserName|class=sIndent}[String] -- the clientId as seen on the server admin page{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getClientID_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getClientID_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getClientID_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientID_sam|trigger=none}{code:language=javascript}
var clientId = security.getClientID()
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getElementUUIDs|class=node}{tr:id=name}{td}h6.getElementUUIDs{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getElementUUIDs{span}{span:id=iets|style=float: left;}\(formname){span}{td}{tr}{tr:id=des}{td}{sub-section:getElementUUIDs_des|text=|trigger=button}{sub-section}{sub-section:getElementUUIDs_des|trigger=none|class=sIndent}Returns the form elements UUID's as dataset, the one with no name is the form itself.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getElementUUIDs_snc|text=|trigger=button}{sub-section}{sub-section:getElementUUIDs_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getElementUUIDs_prs|text=|trigger=button}{sub-section}{sub-section:getElementUUIDs_prs|trigger=none|class=sIndent}\{[String]} formname -- the formname to retieve the dataset for
{sub-section}{td}{tr}{tr:id=sigret}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getSystemUserName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getSystemUserName_des*Returns*\\{sub-section:getElementUUIDs_ret|text=|trigger=button}{sub-section}{sub-section:getSystemUserNamegetElementUUIDs_desret|trigger=none|class=sIndent}Retrieves the username of the currently logged in user on operating system level.[JSDataSet] -- dataset with element info{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sncsee}{td}*SinceAlso see*\\{sub-section:getSystemUserNamegetElementUUIDs_sncsee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSystemUserNamegetElementUUIDs_sncsee|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prslink}{td}*ParametersExternal links*\\{sub-section:getSystemUserNamegetElementUUIDs_prslink|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSystemUserNamegetElementUUIDs_prslink|trigger=none|class=sIndent}{sub-section}{div}{td}{tr}{builder-show}{tr:id=retsam}{td}*ReturnsSample*\\{sub-section:getSystemUserNamegetElementUUIDs_retsam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSystemUserNamegetElementUUIDs_retsam|trigger=none|class=sIndent}[String] -- the os user name}{code:language=javascript}
var formElementsUUIDDataSet = security.getElementUUIDs('orders_form');
{code}{sub-section}{div}{td}{tr}{builder-showtr:permissionclass=editlastDetailRow}{tr:id=seetd}{td}*Also see*\\{sub-section:getSystemUserName_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSystemUserName_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getSystemUserName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSystemUserName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show{tr}{tbody}{tbody:id=getGroups|class=node}{tr:id=name}{td}h6.getGroups{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getGroups{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=samdes}{td}*Sample*\\{sub-section:getSystemUserNamegetGroups_samdes|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSystemUserNamegetGroups_samdes|trigger=none}{code:language=javascript}
//gets the current os username
var osUserName = security.getSystemUserName();
{code}|class=sIndent}Get all the groups (returns a dataset).
first id column is deprecated!, use only the group name column.{sub-section}{div}{td}{tr}{trbuilder-show:classpermission=lastDetailRowedit}{tdtr:id=snc}{td}{tr}{tbody}{tbody:id=getUserGroups|class=node}{tr:id=name}{td}h6.getUserGroups{td}{tr*Since*\\{sub-section:getGroups_snc|text=|trigger=button}{sub-section}{sub-section:getGroups_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sigprs}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserGroups{span}{span:id=iets|style=float: left;}\(){span*Parameters*\\{sub-section:getGroups_prs|text=|trigger=button}{sub-section}{sub-section:getGroups_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=desret}{td}*Returns*\\{sub-section:getUserGroupsgetGroups_desret|text=|trigger=button}{sub-section}{sub-section:getUserGroupsgetGroups_desret|trigger=none|class=sIndent}Get all the groups of[JSDataSet] -- dataset with all the current user.groups{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sncsee}{td}*SinceAlso see*\\{sub-section:getUserGroupsgetGroups_sncsee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroupsgetGroups_sncsee|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prslink}{td}*ParametersExternal links*\\{sub-section:getUserGroupsgetGroups_prslink|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroupsgetGroups_prslink|trigger=none|class=sIndent}{sub-section}{div}{td}{tr}{builder-show}{tr:id=retsam}{td}*ReturnsSample*\\{sub-section:getUserGroupsgetGroups_retsam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroupsgetGroups_retsam|trigger=none|class=sIndent}[JSDataSet] -- dataset with groupnames{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getUserGroups_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroups_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUserGroups_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroups_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUserGroups_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroups_sam|trigger=none}{code:language=javascript}
//get all the users in the security settings (Returns a JSDataset)
var dsUsers = security.getUsers()

//loop through each user to get their group
//The getValue call is (row,column) where column 1 == id and 2 == name
for(var i=1 ; i<=dsUsers.getMaxRowIndex() ; i++)
{
	//print to the output debugger tab: "user: " and the username
	application.output("user:" + dsUsers.getValue(i,2));

	//set p to the user group for the current user
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		//print todelete the outputuser debugger(the tab: "group" and the group(s)
		//the user belongs to
		application.output("group: " + p.getValue(k,2))user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUserGroups-ObjectgetSystemUserName|class=node}{tr:id=name}{td}h6.getUserGroupsgetSystemUserName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSetString]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserGroupsgetSystemUserName{span}{span:id=iets|style=float: left;}\(userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:getUserGroups-ObjectgetSystemUserName_des|text=|trigger=button}{sub-section}{sub-section:getUserGroups-ObjectgetSystemUserName_des|trigger=none|class=sIndent}Get allRetrieves the username of the groupscurrently forlogged givenin user UID on operating system level.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUserGroups-ObjectgetSystemUserName_snc|text=|trigger=button}{sub-section}{sub-section:getUserGroups-ObjectgetSystemUserName_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getUserGroups-ObjectgetSystemUserName_prs|text=|trigger=button}{sub-section}{sub-section:getUserGroups-ObjectgetSystemUserName_prs|trigger=none|class=sIndent}\{[Object]} userUID -- to retrieve the user groups
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUserGroups-ObjectgetSystemUserName_ret|text=|trigger=button}{sub-section}{sub-section:getUserGroups-ObjectgetSystemUserName_ret|trigger=none|class=sIndent}[JSDataSetString] -- datasetthe os withuser groupnamesname{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getUserGroups-ObjectgetSystemUserName_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroups-ObjectgetSystemUserName_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUserGroups-ObjectgetSystemUserName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroups-ObjectgetSystemUserName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUserGroups-ObjectgetSystemUserName_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserGroups-Object_getSystemUserName_sam|trigger=none}{code:language=javascript}
//getgets all the userscurrent in the security settings (Returns a JSDataset)
var dsUsersos username
var osUserName = security.getUsersgetSystemUserName()

//loop through each user to get their group
//The getValue call is (row,column) where column 1 == id and 2 == name
for(var i=1 ; i<=dsUsers.getMaxRowIndex() ; i++)
{
	//print to the output debugger tab: "user: " and the username
	application.output("user:" + dsUsers.getValue(i,2));

	//set p to the user group for the current user
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "group" and the group(s)
		//the user belongs to
		application.output("group: " + p.getValue(k,2));
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUserName|class=node}{tr:id=name}{td}h6.getUserName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserName{span}{span:id=iets|style=float: left;}\(\[userUID\]){span}{td}{tr}{tr:id=des}{td}{sub-section:getUserName_des|;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUserGroups|class=node}{tr:id=name}{td}h6.getUserGroups{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserGroups{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getUserGroups_des|text=|trigger=button}{sub-section}{sub-section:getUserGroups_des|trigger=none|class=sIndent}Get all the groups of the current user.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUserGroups_snc|text=|trigger=button}{sub-section}{sub-section:getUserGroups_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getUserGroups_prs|text=|trigger=button}{sub-section}{sub-section:getUserGroups_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUserGroups_ret|text=|trigger=button}{sub-section}{sub-section:getUserNamegetUserGroups_desret|trigger=none|class=sIndent}Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.[JSDataSet] -- dataset with groupnames{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sncsee}{td}*SinceAlso see*\\{sub-section:getUserNamegetUserGroups_sncsee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserNamegetUserGroups_sncsee|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prslink}{td}*ParametersExternal links*\\{sub-section:getUserNamegetUserGroups_prslink|text=|trigger=button}{sub-section}{sub-section:getUserName_prs|trigger=none|div:class=sIndent}\[userUID\] -- to retrieve the name
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getUserName_ret|text=:getUserGroups_link|trigger=buttonnone}{sub-section}{sub-section:getUserName_ret|trigger=none|class=sIndent}[String] -- the user name{sub-section}div}{td}{tr}{builder-show:permission=edit}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:getUserNamegetUserGroups_seesam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserNamegetUserGroups_seesam|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUserName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUserName_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserName_sam|trigger=none}{code:language=javascript}
//gets the current loggedIn username
var userName = security.getUserName();code:language=javascript}
//get all the users in the security settings (Returns a JSDataset)
var dsUsers = security.getUsers()

//loop through each user to get their group
//The getValue call is (row,column) where column 1 == id and 2 == name
for(var i=1 ; i<=dsUsers.getMaxRowIndex() ; i++)
{
	//print to the output debugger tab: "user: " and the username
	application.output("user:" + dsUsers.getValue(i,2));

	//set p to the user group for the current user
	/** @type {JSDataSet} */
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "group" and the group(s)
		//the user belongs to
		application.output("group: " + p.getValue(k,2));
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUserUIDgetUserGroups-Object|class=node}{tr:id=name}{td}h6.getUserUIDgetUserGroups{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[StringJSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserUIDgetUserGroups{span}{span:id=iets|style=float: left;}\(\[username\]userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:getUserUIDgetUserGroups-Object_des|text=|trigger=button}{sub-section}{sub-section:getUserUIDgetUserGroups-Object_des|trigger=none|class=sIndent}Get all the groups for currentgiven user UID (null if not logged in), finds the userUID for given user\_name if passed as parameter..{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUserUIDgetUserGroups-Object_snc|text=|trigger=button}{sub-section}{sub-section:getUserUIDgetUserGroups-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getUserUIDgetUserGroups-Object_prs|text=|trigger=button}{sub-section}{sub-section:getUserUIDgetUserGroups-Object_prs|trigger=none|class=sIndent}\{[username\Object]} userUID -- the username to findretrieve the userUIDuser forgroups
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getUserUIDgetUserGroups-Object_ret|text=|trigger=button}{sub-section}{sub-section:getUserUIDgetUserGroups-Object_ret|trigger=none|class=sIndent}[StringJSDataSet] -- dataset thewith userUIDgroupnames{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getUserUIDgetUserGroups-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserUIDgetUserGroups-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUserUIDgetUserGroups-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserUIDgetUserGroups-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUserUIDgetUserGroups-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserUIDgetUserGroups-Object_sam|trigger=none}{code:language=javascript}
//getsget all the users in the current loggedIn usernamesecurity settings (Returns a JSDataset)
var userNamedsUsers = security.getUserNamegetUsers();

//gets the uid of the given username
var userUID = security.getUserUID(userName);
//is the same as above 
//var my_userUID = security.getUserUID();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUsers|class=node}{tr:id=name}{td}h6.getUsers{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}getUsers{span}{span:id=iets|style=float: left;}\(\[groupName\]){span}{td}{tr}{tr:id=des}{td}{sub-section:getUsers_des|text=|trigger=button}{sub-section}{sub-section:getUsers_des|trigger=none|class=sIndent}Get all the users in the security settings (returns a dataset).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUsers_snc|text=|trigger=button}{sub-section}{sub-section:getUsers_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getUsers_prs|text=|trigger=button}{sub-section}{sub-section:getUsers_prs|trigger=none|class=sIndent}\[groupName\] -- the group to filter on
{sub-sectionloop through each user to get their group
//The getValue call is (row,column) where column 1 == id and 2 == name
for(var i=1 ; i<=dsUsers.getMaxRowIndex() ; i++)
{
	//print to the output debugger tab: "user: " and the username
	application.output("user:" + dsUsers.getValue(i,2));

	//set p to the user group for the current user
	/** @type {JSDataSet} */
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "group" and the group(s)
		//the user belongs to
		application.output("group: " + p.getValue(k,2));
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUserName|class=node}{tr:id=name}{td}h6.getUserName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=retdes}{td}*Returns*\\{sub-section:getUsersgetUserName_retdes|text=|trigger=button}{sub-section}{sub-section:getUsersgetUserName_retdes|trigger=none|class=sIndent}[JSDataSet] -- dataset with all the usersGet the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=seesnc}{td}*Also seeSince*\\{sub-section:getUsersgetUserName_seesnc|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUsersgetUserName_seesnc|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:getUsersgetUserName_linkprs|text=|trigger=button}{sub-section}{div:class=sIndent}sub-section:getUserName_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUsers_linkgetUserName_ret|text=|trigger=nonebutton}{sub-section}{sub-section:getUserName_ret|trigger=none|class=sIndent}{div[String] -- the user name{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=samsee}{td}*SampleAlso see*\\{sub-section:getUsersgetUserName_samsee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUsersgetUserName_samsee|trigger=none}{code:language=javascript}
//get all the users in the security settings (Returns a JSDataset)
var dsUsers = security.getUsers()

//loop through each user to get their group
//The getValue call is (row,column) where column 1 == id and 2 == name
for(var i=1 ; i<=dsUsers.getMaxRowIndex() ; i++)
{
	//print to the output debugger tab: "user: " and the username
	application.output("user:" + dsUsers.getValue(i,2));

	//set p to the user group for the current user
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "group" and the group(s)
		//the user belongs to
		application.output("group: " + p.getValue(k,2));
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isUserMemberOfGroup-String|class=node}{tr:id=name}{td}h6.isUserMemberOfGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isUserMemberOfGroup{span}{span:id=iets|style=float: left;}\(groupName){spansub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUserName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUserName_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUserName_sam|trigger=none}{code:language=javascript}
//gets the current loggedIn username
var userName = security.getUserName();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUserName-Object|class=node}{tr:id=name}{td}h6.getUserName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getUserName{span}{span:id=iets|style=float: left;}\(userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:getUserName-Object_des|text=|trigger=button}{sub-section}{sub-section:getUserName-Object_des|trigger=none|class=sIndent}Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUserName-Object_snc|text=|trigger=button}{sub-section}{sub-section:getUserName-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=desprs}{td}*Parameters*\\{sub-section:isUserMemberOfGroupgetUserName-StringObject_desprs|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroupgetUserName-StringObject_desprs|trigger=none|class=sIndent}Check whatever\{[Object]} userUID -- the currentuser userUID isused partto ofretrieve the specifiedname
group{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sncret}{td}*SinceReturns*\\{sub-section:isUserMemberOfGroupgetUserName-StringObject_sncret|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroupgetUserName-StringObject_sncret|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:isUserMemberOfGroup-String_prs|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroup-String_prs|trigger=none|class=sIndent}\{[String]} groupName -- name of the group to check
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:isUserMemberOfGroup-String_ret|text=|trigger=button}user name{sub-section}{sub-section:isUserMemberOfGroup-String_ret|trigger=none|class=sIndent}[Boolean] -- dataset with groupnames{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:isUserMemberOfGroupgetUserName-StringObject_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isUserMemberOfGroupgetUserName-StringObject_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:isUserMemberOfGroupgetUserName-StringObject_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isUserMemberOfGroupgetUserName-StringObject_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:isUserMemberOfGroupgetUserName-StringObject_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isUserMemberOfGroupgetUserName-StringObject_sam|trigger=none}{code:language=javascript}
//checkgets whateverthe usercurrent isloggedIn partusername
ofvar theuserName Administrators group= if(security.isUserMemberOfGroup('Administrators', security.getUserUID('admin')))
{
		// do administration stuff
}
getUserName();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isUserMemberOfGroup-String_ObjectgetUserUID|class=node}{tr:id=name}{td}h6.isUserMemberOfGroupgetUserUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[BooleanString]{span}{span:id=iets|style=float: left; font-weight: bold;}isUserMemberOfGroupgetUserUID{span}{span:id=iets|style=float: left;}\(groupName, userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:isUserMemberOfGroup-StringgetUserUID_Object_des|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroup-StringgetUserUID_Object_des|trigger=none|class=sIndent}CheckGet whateverthe thecurrent user specified as parameter is part of the specified groupUID (null if not logged in); finds the userUID for given user\_name if passed as parameter.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_snc|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:isUserMemberOfGroup-StringgetUserUID_Object_prs|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_prs|trigger=none|class=sIndent}\{[String]} groupName -- name of the group to check
\{[Object]} userUID -- UID of the user to check
{sub-section}{td}{tr}{tr:builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_ret|text=|trigger=button}{sub-section}{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_ret|trigger=none|class=sIndent}[BooleanString] -- datasetthe with groupnamesuserUID{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:isUserMemberOfGroup-StringgetUserUID_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:isUserMemberOfGroup-String_ObjectgetUserUID_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:isUserMemberOfGroup-StringgetUserUID_Object_sam|trigger=none}{code:language=javascript}
//check whatever user is partgets the current loggedIn username
var userName = security.getUserName(); 
//gets the uid of the given username
Administratorsvar group
if(security.isUserMemberOfGroup('Administrators',userUID = security.getUserUID('admin')))
{
		// do administration stuff
}
userName);
//is the same as above 
//var my_userUID = security.getUserUID();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=logingetUserUID-String|class=node}{tr:id=name}{td}h6.logingetUserUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[BooleanString]{span}{span:id=iets|style=float: left; font-weight: bold;}logingetUserUID{span}{span:id=iets|style=float: left;}\(display_username, a_userUID, groups){span}{td}{tr}{tr:id=des}{td}{sub-section:logingetUserUID-String_des|text=|trigger=button}{sub-section}{sub-section:logingetUserUID-String_des|trigger=none|class=sIndent}LoginGet tothe becurrent ableuser toUID leave(null theif solutionnot loginForm.logged in); Example:finds Groupthe namesuserUID mayfor be received from LDAP (Lightweight Directory Access Protocol) \- a standard protocol used in web browsers and email applications to enable lookup queries that access a directory listinggiven user\_name if passed as parameter.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:logingetUserUID-String_snc|text=|trigger=button}{sub-section}{sub-section:logingetUserUID-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:logingetUserUID-String_prs|text=|trigger=button}{sub-section}{sub-section:logingetUserUID-String_prs|trigger=none|class=sIndent}\{[String]} display_username -- the userusername displayto name, like 'James Webb'
\{[Object]} a_userUID -- the user UID to process login for
\{[String]\[]} groups -- the groups arrayfind the userUID for
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:logingetUserUID-String_ret|text=|trigger=button}{sub-section}{sub-section:logingetUserUID-String_ret|trigger=none|class=sIndent}[BooleanString] -- truethe if loggedinuserUID{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:logingetUserUID-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logingetUserUID-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:logingetUserUID-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logingetUserUID-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:logingetUserUID-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logingetUserUID-String_sam|trigger=none}{code:language=javascript}
//gets the current loggedIn username
var groupsuserName = new Arraysecurity.getUserName(); groups[0] =
'Administrators'; //normallygets thesethe groupsuid areof forthe example received from LDAPgiven username
var user_uiduserUID = globals.emailsecurity.getUserUID(userName);
//alsois thisthe uidsame mightas beabove received from external authentication method
var ok = 
//var my_userUID = security.login(globals.username, user_uid , groups)
if (!ok)
{
	plugins.dialogs.showErrorDialog('Login failure',  'Already logged in? or no user_uid/groups specified?', 'OK')
}getUserUID();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=logoutgetUsers|class=node}{tr:id=name}{td}h6.logoutgetUsers{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void[JSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}logoutgetUsers{span}{span:id=iets|style=float: left;}\(\[solutionToLoad\], \[method\], \[argument\]){span}{td}{tr}{tr:id=des}{td}{sub-section:logoutgetUsers_des|text=|trigger=button}{sub-section}{sub-section:logoutgetUsers_des|trigger=none|class=sIndent}LogoutGet the current user and close all the solution,users ifin the solutionsecurity requiressettings authentication(returns and user is logged in.
You can redirect to another solution if needed; if you want to go to a different url, you need to call application.showURL(url) before calling security.logout() (this is only applicable for Web Client).
An alternative option to close a solution and to open another solution, while keeping the user logged in, is application.closeSolution().{sub-a dataset).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:logoutgetUsers_snc|text=|trigger=button}{sub-section}{sub-section:logoutgetUsers_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:logoutgetUsers_prs|text=|trigger=button}{sub-section}{sub-section:logoutgetUsers_prs|trigger=none|class=sIndent}\[solutionToLoad\] -- the solution to load after logout
\[method\] -- the method to run in the solution to load
\[argument\] -- the argument to pass to the method to run
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:logout_ret|{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUsers_ret|text=|trigger=button}{sub-section}{sub-section:logoutgetUsers_ret|trigger=none|class=sIndent}void[JSDataSet] -- dataset with all the users{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:logoutgetUsers_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logoutgetUsers_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:logoutgetUsers_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logoutgetUsers_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:logoutgetUsers_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logoutgetUsers_sam|trigger=none}{code:language=javascript}
//Setget all the urlusers toin gothe tosecurity aftersettings logout.(Returns  //application.showURL('http://www.servoy.com', '_self');  //Web Client only
 security.logout();
	//security.logout('solution_name');//log out and close current solution and open solution 'solution_name'
	//security.logout('solution_name','global_method_name','my_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
	//Note: specifying a solution will not work in the Developer due to debugger dependencies
 //specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type )
{a JSDataset)
var dsUsers = security.getUsers()

//loop through each user to get their group
//The getValue call is (row,column) where column 1 == id and 2 == name
for(var i=1 ; i<=dsUsers.getMaxRowIndex() ; i++)
{
	//print to the output debugger tab: "user: " and the username
	application.output("user:" + dsUsers.getValue(i,2));

	//set p to the user group for the current user
	/** @type {JSDataSet} */
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "group" and the group(s)
		//the user belongs to
		application.output("group: " + p.getValue(k,2));
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeUserFromGroupgetUsers-String|class=node}{tr:id=name}{td}h6.removeUserFromGroupgetUsers{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[BooleanJSDataSet]{span}{span:id=iets|style=float: left; font-weight: bold;}removeUserFromGroupgetUsers{span}{span:id=iets|style=float: left;}\(a_userUID, groupName){span}{td}{tr}{tr:id=des}{td}{sub-section:removeUserFromGroupgetUsers-String_des|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroupgetUsers-String_des|trigger=none|class=sIndent}Removes an user fromGet all the users in the security settings (returns a groupdataset).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeUserFromGroupgetUsers-String_snc|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroupgetUsers-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:removeUserFromGroupgetUsers-String_prs|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroupgetUsers-String_prs|trigger=none|class=sIndent}\{[ObjectString]} a_userUID -- the user UID to be removed
\{[Object]} groupName -- the group to removefilter fromon
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:removeUserFromGroupgetUsers-String_ret|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroupgetUsers-String_ret|trigger=none|class=sIndent}[BooleanJSDataSet] -- dataset with trueall ifthe removedusers{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeUserFromGroupgetUsers-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeUserFromGroupgetUsers-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeUserFromGroupgetUsers-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeUserFromGroupgetUsers-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeUserFromGroupgetUsers-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeUserFromGroupgetUsers-String_sam|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid
//get all the users in the security settings (Returns a JSDataset)
var dsUsers = security.createUser('myusername', 'mypassword');
if (uid)getUsers()

//testloop through ifeach user to wasget createdtheir {group
	// Get all the groups
	var set = security.getGroups();
	The getValue call is (row,column) where column 1 == id and 2 == name
for(var p i= 1 ; p <= seti<=dsUsers.getMaxRowIndex() ; pi++)
	{
		//print to the output name of debugger tab: "user: " and the groupusername
		application.output(set"user:" + dsUsers.getValue(pi, 2));

		//set addp to the user togroup group
		security.addUserToGroup(uid, set.getValue(p,2));
	}for the current user
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set** @type {JSDataSet} */
	var p = security.getUserGroups(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();pk++)
		{
			//print to the output name of debugger tab: "group" and the group
			application.output(set.getValue(p, 2));(s)
			// remove the user frombelongs the groupto
			securityapplication.removeUserFromGroup(uid, setoutput("group: " + p.getValue(pk,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setPasswordisUserMemberOfGroup-String|class=node}{tr:id=name}{td}h6.setPasswordisUserMemberOfGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setPasswordisUserMemberOfGroup{span}{span:id=iets|style=float: left;}\(a_userUID, passwordgroupName){span}{td}{tr}{tr:id=des}{td}{sub-section:setPasswordisUserMemberOfGroup-String_des|text=|trigger=button}{sub-section}{sub-section:setPasswordisUserMemberOfGroup-String_des|trigger=none|class=sIndent}Set a new password forCheck whatever the current user is part of the givenspecified userUID.group{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setPasswordisUserMemberOfGroup-String_snc|text=|trigger=button}{sub-section}{sub-section:setPasswordisUserMemberOfGroup-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setPasswordisUserMemberOfGroup-String_prs|text=|trigger=button}{sub-section}{sub-section:setPasswordisUserMemberOfGroup-String_prs|trigger=none|class=sIndent}\{[ObjectString]} a_userUIDgroupName -- thename userUID toof set the newgroup password for
\{[String]} password -- the new passwordto check
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setPasswordisUserMemberOfGroup-String_ret|text=|trigger=button}{sub-section}{sub-section:setPasswordisUserMemberOfGroup-String_ret|trigger=none|class=sIndent}[Boolean] -- truedataset ifwith changedgroupnames{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setPasswordisUserMemberOfGroup-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setPasswordisUserMemberOfGroup-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setPasswordisUserMemberOfGroup-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setPasswordisUserMemberOfGroup-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setPasswordisUserMemberOfGroup-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setPasswordisUserMemberOfGroup-String_sam|trigger=none}{code:language=javascript}
//check whatever user is part of the Administrators group
if(security.checkPasswordisUserMemberOfGroup('Administrators', security.getUserUID(), 'password1admin')))
{
	security.setPassword(security.getUserUID(), 'password2')
}
else
{
	application.output('wrong password')
// do administration stuff
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setSecuritySettingsisUserMemberOfGroup-String_Object|class=node}{tr:id=name}{td}h6.setSecuritySettingsisUserMemberOfGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setSecuritySettingsisUserMemberOfGroup{span}{span:id=iets|style=float: left;}\(datasetgroupName, userUID){span}{td}{tr}{tr:id=des}{td}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_des|text=|trigger=button}{sub-section}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_des|trigger=none|class=sIndent}SetsCheck the security settings; whatever the entriesuser containedspecified inas theparameter givenis dataset will override those contained inpart of the current security settings.

NOTE: The security.getElementUUIDs and security.setSecuritySettings functions can be used to define custom security that overrides Servoy security. 
For additional information see the function security.getElementUUIDs.specified group.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_prs|trigger=none|class=sIndent}\{[ObjectString]} datasetgroupName -- name of the dataset with security settingsgroup to check
\{[Object]} userUID -- UID of the user to check
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_ret|trigger=none|class=sIndent}void[Boolean] -- dataset with groupnames{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setSecuritySettingsisUserMemberOfGroup-String_Object_sam|trigger=none}{code:language=javascript}
var//check colNameswhatever =user new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{codeis part of the Administrators group
if(security.isUserMemberOfGroup('Administrators', security.getUserUID('admin')))
{
	// do administration stuff
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setUserUIDlogin|class=node}{tr:id=name}{td}h6.setUserUIDlogin{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setUserUIDlogin{span}{span:id=iets|style=float: left;}\(username, a_userUID, newUserUIDgroups){span}{td}{tr}{tr:id=des}{td}{sub-section:setUserUIDlogin_des|text=|trigger=button}{sub-section}{sub-section:setUserUIDlogin_des|trigger=none|class=sIndent}SetLogin to abe newable userUIDto forleave the givensolution userUID.{sub-section}{td}{tr}{builder-show:permission=loginForm.

Example: Group names may be received from LDAP (Lightweight Directory Access Protocol) \- a standard protocol used in web browsers and email applications to enable lookup queries that access a directory listing.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setUserUIDlogin_snc|text=|trigger=button}{sub-section}{sub-section:setUserUIDlogin_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setUserUIDlogin_prs|text=|trigger=button}{sub-section}{sub-section:setUserUIDlogin_prs|trigger=none|class=sIndent}\{[String]} username -- the username, like 'JamesWebb'
\{[Object]} a_userUID -- the user userUIDUID to setprocess the new user UID login for
\{[String]\[]} newUserUIDgroups -- the newgroups userarray
UID
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setUserUIDlogin_ret|text=|trigger=button}{sub-section}{sub-section:setUserUIDlogin_ret|trigger=none|class=sIndent}[Boolean] -- true if changedloggedin{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setUserUIDlogin_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setUserUIDlogin_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setUserUIDlogin_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setUserUIDlogin_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setUserUIDlogin_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setUserUIDlogin_sam|trigger=none}{code:language=javascript}
var removeUsergroups = true['Administrators']; //create a usernormally these groups are for example received from LDAP
var user_uid = security.createUser('myusername', 'mypassword');
if (uid)scopes.globals.email; //testalso ifthis useruid wasmight createdbe {received 	//from Getexternal allauthentication the groupsmethod
	var setok =  security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);login(scopes.globals.username, user_uid , groups)
if (!ok)
{
	plugins.dialogs.showErrorDialog('Login failure',  'Already logged in? or no user_uid/groups specified?', 'OK')
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=logout|class=node}{tr:id=name}{td}h6.logout{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}logout{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:logout_des|text=|trigger=button}{sub-section}{sub-section:logout_des|trigger=none|class=sIndent}Logout the current user and close the solution, if the solution requires authentication and user is logged in.
You can redirect to another solution if needed; if you want to go to a different url, you need to call application.showURL(url) before calling security.logout() (this is only applicable for Web Client).
An alternative option to close a solution and to open another solution, while keeping the user logged in, is application.closeSolution().{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:logout_snc|text=|trigger=button}{sub-section}{sub-section:logout_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:logout_prs|text=|trigger=button}{sub-section}{sub-section:logout_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:logout_ret|text=|trigger=button}{sub-section}{sub-section:logout_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:logout_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:logout_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:logout_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout_sam|trigger=none}{code:language=javascript}
//Set the url to go to after logout.
//application.showURL('http://www.servoy.com', '_self');  //Web Client only
security.logout();
//security.logout('solution_name');//log out and close current solution and open solution 'solution_name'
//security.logout('solution_name','global_method_name','my_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type )
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=logout-String|class=node}{tr:id=name}{td}h6.logout{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}logout{span}{span:id=iets|style=float: left;}\(solutionToLoad){span}{td}{tr}{tr:id=des}{td}{sub-section:logout-String_des|text=|trigger=button}{sub-section}{sub-section:logout-String_des|trigger=none|class=sIndent}Logout the current user and close the solution, if the solution requires authentication and user is logged in.
You can redirect to another solution if needed; if you want to go to a different url, you need to call application.showURL(url) before calling security.logout() (this is only applicable for Web Client).
An alternative option to close a solution and to open another solution, while keeping the user logged in, is application.closeSolution().{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:logout-String_snc|text=|trigger=button}{sub-section}{sub-section:logout-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:logout-String_prs|text=|trigger=button}{sub-section}{sub-section:logout-String_prs|trigger=none|class=sIndent}\{[String]} solutionToLoad -- the solution to load after logout
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:logout-String_ret|text=|trigger=button}{sub-section}{sub-section:logout-String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:logout-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:logout-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:logout-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_sam|trigger=none}{code:language=javascript}
//Set the url to go to after logout.
//application.showURL('http://www.servoy.com', '_self');  //Web Client only
security.logout();
//security.logout('solution_name');//log out and close current solution and open solution 'solution_name'
//security.logout('solution_name','global_method_name','my_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type )
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=logout-String_String|class=node}{tr:id=name}{td}h6.logout{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}logout{span}{span:id=iets|style=float: left;}\(solutionToLoad, method){span}{td}{tr}{tr:id=des}{td}{sub-section:logout-String_String_des|text=|trigger=button}{sub-section}{sub-section:logout-String_String_des|trigger=none|class=sIndent}Logout the current user and close the solution, if the solution requires authentication and user is logged in.
You can redirect to another solution if needed; if you want to go to a different url, you need to call application.showURL(url) before calling security.logout() (this is only applicable for Web Client).
An alternative option to close a solution and to open another solution, while keeping the user logged in, is application.closeSolution().{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:logout-String_String_snc|text=|trigger=button}{sub-section}{sub-section:logout-String_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:logout-String_String_prs|text=|trigger=button}{sub-section}{sub-section:logout-String_String_prs|trigger=none|class=sIndent}\{[String]} solutionToLoad -- the solution to load after logout
\{[String]} method -- the method to run in the solution to load
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:logout-String_String_ret|text=|trigger=button}{sub-section}{sub-section:logout-String_String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:logout-String_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:logout-String_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:logout-String_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_String_sam|trigger=none}{code:language=javascript}
//Set the url to go to after logout.
//application.showURL('http://www.servoy.com', '_self');  //Web Client only
security.logout();
//security.logout('solution_name');//log out and close current solution and open solution 'solution_name'
//security.logout('solution_name','global_method_name','my_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type )
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=logout-String_String_Object|class=node}{tr:id=name}{td}h6.logout{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}logout{span}{span:id=iets|style=float: left;}\(solutionToLoad, method, argument){span}{td}{tr}{tr:id=des}{td}{sub-section:logout-String_String_Object_des|text=|trigger=button}{sub-section}{sub-section:logout-String_String_Object_des|trigger=none|class=sIndent}Logout the current user and close the solution, if the solution requires authentication and user is logged in.
You can redirect to another solution if needed; if you want to go to a different url, you need to call application.showURL(url) before calling security.logout() (this is only applicable for Web Client).
An alternative option to close a solution and to open another solution, while keeping the user logged in, is application.closeSolution().{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:logout-String_String_Object_snc|text=|trigger=button}{sub-section}{sub-section:logout-String_String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:logout-String_String_Object_prs|text=|trigger=button}{sub-section}{sub-section:logout-String_String_Object_prs|trigger=none|class=sIndent}\{[String]} solutionToLoad -- the solution to load after logout
\{[String]} method -- the method to run in the solution to load
\{[Object]} argument -- the argument to pass to the method to run
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:logout-String_String_Object_ret|text=|trigger=button}{sub-section}{sub-section:logout-String_String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:logout-String_String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:logout-String_String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:logout-String_String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:logout-String_String_Object_sam|trigger=none}{code:language=javascript}
//Set the url to go to after logout.
//application.showURL('http://www.servoy.com', '_self');  //Web Client only
security.logout();
//security.logout('solution_name');//log out and close current solution and open solution 'solution_name'
//security.logout('solution_name','global_method_name','my_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//Note: specifying a solution will not work in the Developer due to debugger dependencies
//specified solution should be of compatible type with client (normal type or client specific(Smart client only/Web client only) type )
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeUserFromGroup|class=node}{tr:id=name}{td}h6.removeUserFromGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}removeUserFromGroup{span}{span:id=iets|style=float: left;}\(a_userUID, groupName){span}{td}{tr}{tr:id=des}{td}{sub-section:removeUserFromGroup_des|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroup_des|trigger=none|class=sIndent}Removes an user from a group.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeUserFromGroup_snc|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:removeUserFromGroup_prs|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroup_prs|trigger=none|class=sIndent}\{[Object]} a_userUID -- the user UID to be removed
\{[Object]} groupName -- the group to remove from
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:removeUserFromGroup_ret|text=|trigger=button}{sub-section}{sub-section:removeUserFromGroup_ret|trigger=none|class=sIndent}[Boolean] -- true if removed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeUserFromGroup_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeUserFromGroup_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeUserFromGroup_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeUserFromGroup_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeUserFromGroup_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeUserFromGroup_sam|trigger=none}{code:language=javascript}
var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the groups
	var set = security.getGroups();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the group
		application.output(set.getValue(p, 2));
		// add user to group
		security.addUserToGroup(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the groups
	if(!removeUser)
	{
		// get now all the groups that that users has (all if above did go well)
		var set =security.getUserGroups(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the group
			application.output(set.getValue(p, 2));
			// remove the user from the group
			security.removeUserFromGroup(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the groups)
		security.deleteUser(uid);
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setPassword|class=node}{tr:id=name}{td}h6.setPassword{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setPassword{span}{span:id=iets|style=float: left;}\(a_userUID, password){span}{td}{tr}{tr:id=des}{td}{sub-section:setPassword_des|text=|trigger=button}{sub-section}{sub-section:setPassword_des|trigger=none|class=sIndent}Set a new password for the given userUID.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setPassword_snc|text=|trigger=button}{sub-section}{sub-section:setPassword_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setPassword_prs|text=|trigger=button}{sub-section}{sub-section:setPassword_prs|trigger=none|class=sIndent}\{[Object]} a_userUID -- the userUID to set the new password for
\{[String]} password -- the new password
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setPassword_ret|text=|trigger=button}{sub-section}{sub-section:setPassword_ret|trigger=none|class=sIndent}[Boolean] -- true if changed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setPassword_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setPassword_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setPassword_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setPassword_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setPassword_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setPassword_sam|trigger=none}{code:language=javascript}
if(security.checkPassword(security.getUserUID(), 'password1'))
{
	security.setPassword(security.getUserUID(), 'password2')
}
else
{
	application.output('wrong password')
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setSecuritySettings|class=node}{tr:id=name}{td}h6.setSecuritySettings{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setSecuritySettings{span}{span:id=iets|style=float: left;}\(dataset){span}{td}{tr}{tr:id=des}{td}{sub-section:setSecuritySettings_des|text=|trigger=button}{sub-section}{sub-section:setSecuritySettings_des|trigger=none|class=sIndent}Sets the security settings; the entries contained in the given dataset will override those contained in the current security settings.

NOTE: The security.getElementUUIDs and security.setSecuritySettings functions can be used to define custom security that overrides Servoy security. 
For additional information see the function security.getElementUUIDs.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setSecuritySettings_snc|text=|trigger=button}{sub-section}{sub-section:setSecuritySettings_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setSecuritySettings_prs|text=|trigger=button}{sub-section}{sub-section:setSecuritySettings_prs|trigger=none|class=sIndent}\{[Object]} dataset -- the dataset with security settings
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setSecuritySettings_ret|text=|trigger=button}{sub-section}{sub-section:setSecuritySettings_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setSecuritySettings_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setSecuritySettings_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setSecuritySettings_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setSecuritySettings_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setSecuritySettings_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setSecuritySettings_sam|trigger=none}{code:language=javascript}
var colNames = new Array();
colNames[0] = 'uuid';
colNames[1] = 'flags';
var dataset = databaseManager.createEmptyDataSet(0,colNames);

var row = new Array();
row[0] = '413a4d69-becb-4ae4-8fdd-980755d6a7fb';//normally retreived via security.getElementUUIDs(...)
row[1] = JSSecurity.VIEWABLE|JSSecurity.ACCESSIBLE; // use bitwise 'or' for both
dataset.addRow(row);//setting element security

row = new Array();
row[0] = 'example_data.orders';
row[1] = JSSecurity.READ|JSSecurity.INSERT|JSSecurity.UPDATE|JSSecurity.DELETE|JSSecurity.TRACKING; //use bitwise 'or' for multiple flags
dataset.addRow(row);//setting table security

security.setSecuritySettings(dataset);//to be called in solution startup method
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setUserUID|class=node}{tr:id=name}{td}h6.setUserUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setUserUID{span}{span:id=iets|style=float: left;}\(a_userUID, newUserUID){span}{td}{tr}{tr:id=des}{td}{sub-section:setUserUID_des|text=|trigger=button}{sub-section}{sub-section:setUserUID_des|trigger=none|class=sIndent}Set a new userUID for the given userUID.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setUserUID_snc|text=|trigger=button}{sub-section}{sub-section:setUserUID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setUserUID_prs|text=|trigger=button}{sub-section}{sub-section:setUserUID_prs|trigger=none|class=sIndent}\{[Object]} a_userUID -- the userUID to set the new user UID for
\{[String]} newUserUID -- the new user UID
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setUserUID_ret|text=|trigger=button}{sub-section}{sub-section:setUserUID_ret|trigger=none|class=sIndent}[Boolean] -- true if changed{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setUserUID_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setUserUID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setUserUID_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setUserUID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setUserUID_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setUserUID_sam|trigger=none}{code:language=javascript}
var deleteGroup = true;
//ceate a group
var groupName = security.creategroup('myGroup');
if (groupName)
{
	//create a user
	var uid = security.createUser('myusername', 'mypassword');
	if (uid) //test if user was created
	{
		//set a newUID for the user
		var isChanged = security.setUserUID(uid,'myUserUID')
		// add user to group
		security.addUserToGroup(uid, groupName);
		// if not delete group, do delete group
		if (deleteGroup) 
		{
			security.deleteGroup(groupName);
		}
	}
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}