Docs
ServoyCloudSupportSamplesOpen SourceCommunity
  • Home
  • GUIDES
    • Platform Overview
    • Get Servoy
    • Get Started
      • Chapter 0
      • Chapter 1
      • Chapter 2
      • Chapter 3
      • Chapter 4
      • Chapter 5
    • Get Help
      • SuLA Instructions
      • SuLA Terms
    • Develop
      • Application Design
        • Forms
          • Layout Management
            • Simple Layout
            • Fully Responsive
              • Bootstrap 12-Grid
              • Flexbox
              • Custom Div
              • Collapsible Container
              • Simple Collapsible
              • Center Container
              • Inline Group Container
            • Abstract Form
          • Form Containers
            • Form Container
            • Tab Panel
            • Split Pane
            • Collapse
            • Accordion Panel
            • Form Component
            • List Form Component
          • Form Inheritance
          • Form Components
        • UI Components
          • Buttons and Text
            • Badge
            • Button
            • Data Label
            • Dropdown
            • Image
            • Label
          • Grids
            • Data Grid
            • Power Grid
            • Table
          • Input Controls
            • Calendar
            • Calendar Inline
            • Checkbox
            • Choice Group
            • Combobox
            • Group Buttons
            • Html Area
            • Input Group
            • Rating
            • Slider
            • Switch
            • Spinner
            • TextArea
            • Textbox
            • TextBoxGroup
            • Type Ahead
            • select2tokenizer
          • Media
            • Carousel
            • Embedded YouTube
            • File upload
            • Image label
            • Lightbox Gallery
            • MultiFile Upload
            • PDF JS Viewer
            • PDF Viewer
          • Mobile
            • Native Data List
            • Native Select
          • Navigation
            • Breadcrumbs
            • Navbar
            • sidenav
          • Visualization
            • DBTreeview
            • Progress Bar
            • Treeview
            • ChartJS
              • Data Labels Plugin
              • Funnel Chart
              • OutLabels Plugin
              • TreeMap
          • Specialized Components
            • Smart Document Editor
            • Servoy PDF Viewer
            • Fullcalendar Component
              • Fullcalendar
              • Fullcalendar Events
              • Migrating calendar from Smart and Web client to NG client
            • Fullcalendar Component 2
            • Canvas
            • Google Charts
            • Google Maps
            • svySignature
            • svywebcam
        • Styling and Themes
          • Default Theme Properties
          • CSS / LESS
          • Component Variants
          • Font Icons
        • Data Modeling
          • Databases
            • Tables
              • Columns
              • Calculations
              • Aggregations
              • Methods
              • Events / Triggers
              • Table security
            • Views
            • Procedures
          • Relations
          • Value Lists
          • Menus
          • In-Memory Databases
          • View Datasource
        • Modular Design
      • Programming Guide
        • Scripting the UI
          • Scripting Forms
          • Interacting with Components
          • Navigation
          • Windows, Dialogs and Popups
          • Events Manager
        • Working with Data
          • Concepts
          • Loading
          • Sorting
          • Iterating
          • Searching
            • Find mode
            • Query Builder
            • SQL String
          • Filtering
          • Editing
          • Validation
        • Automation and Scheduling
          • Batch Processor
          • Headless API
          • Scheduler API
        • Creating REST APIs
        • Consuming Webservices
        • Working with Files
          • File Plugin Basics
          • Images
          • Excel
          • PDF
          • JSON
        • Browser Utilities
          • Notifications
            • Web Notifications (Toastr)
            • Web Notifications (Native)
            • Block UI
          • Session Management
          • Keyboard Utilities
          • NG Utils
        • Sending and Receiving Email
        • Servoy Jasper Reports
          • Input Type
          • Display Mode
          • Output format
          • Jaspe Reports Viewer
        • Extensions
          • Modules
            • svyPhonegap
              • First Use Guide
              • Barcode Scanner
              • Browser
              • Camera
              • File
              • Fingerprint
              • Location
              • Network Interface
              • Phonegap
              • Printer
              • Push Notifications
            • svyAPI
              • Getting Started
            • svyLookup
              • Custom Templates
              • API Documentation
              • svyLookup v1
                • API Documentation v1.0.0
                • Base Form svyLookupTable v1.0.0
                • Base Form AbstractLookup v1.0.0
            • svyNavigation
              • API Documentation
                • API svyNavigation
                • API svyNavigationHistory
                • API svyNavigationUX
            • svyPopupFilter
              • Simple Filter Pickers
              • Custom Templates
              • API Documentation
                • API svyToolbarFilter
                • API svyPopupFilter
              • API Documentation v1
                • API svyToolbarFilter v1
                • API svyPopupFilter v1
            • svySearch
            • svySecurity
              • Overview
              • Token-based Auth and SSO (NEW!)
              • API Documentation
              • Getting Started
              • Tenant replication
              • Security Management Console
                • Classic Security Management Console
              • svySecurityUX
              • svyProperties
              • API Doc svyProperties
            • svyUtils
              • Log Manager
              • Log Manager Appenders
              • Smart Doc Editor Utils
              • Custom Dialogs
              • Excel Utils
                • Full API Reference
              • Crypto Utils
      • Security
        • Authentication
        • Permissions
          • UI Permissions
          • Data Permissions
          • Runtime Permissions
        • Audit Logging
        • OAuth
        • JWT
      • Multi-Language Support
      • Mobile Development
        • Getting Started
        • Mobile Design
        • Native Mobile Integrations
        • Building a Native Binary for the App Store
      • Native Desktop Development
        • NGDesktop UI plugin
        • NGDesktop Utils
        • NGDesktop File Plugin
    • Deploy
      • WAR Deployment
      • Docker Deployment
      • Server Configuration
        • Server Settings
        • Server Plugins
        • Database Servers
          • Locks
          • Transactions
          • Oracle
          • SQLServer
        • Client Sessions
        • Batch Processors
        • License Management
        • Monitoring
          • Server Log
          • Browser Console Log
          • Websocket Log
          • Query Performance
          • Client Performance
          • Client Event Tracing
          • Monitoring Servoy with JMX
      • NGClient deployment
      • Troubleshooting
      • Other Topics
        • Security: Cross-site Scripting
        • Running in an iFrame
    • Extend
    • Contribute
  • Reference
    • Servoy Core
      • Object Model
        • Database Server
          • Table
            • Column
            • Calculation
            • Method
            • Aggregation
          • View
          • Procedure
        • Solution
          • Form
          • Form Component
          • Relation
          • Relation Item
          • Table Node
          • Value List
          • Menu
          • Menu item
          • In-Memory Data Source
          • View Foundset Data Source
          • Variable
          • Column Info
          • Media
          • Layout Container
          • Method
        • i18n Message Key
      • Developer API
        • Globals
        • Forms
          • RuntimeForm
            • controller
            • containers
              • RuntimeContainer
            • elements
              • Component
              • RuntimeAccordionPanel
              • RuntimeBean
              • RuntimeButton
              • RuntimeCalendar
              • RuntimeCheck
              • RuntimeCombobox
              • RuntimeComponent
              • RuntimeDataButton
              • RuntimeDataLabel
              • RuntimeGroup
              • RuntimeHtmlArea
              • RuntimeImageMedia
              • RuntimeInsetList
              • RuntimeLabel
              • RuntimeListBox
              • RuntimePassword
              • RuntimePortal
              • RuntimeRadio
              • RuntimeChecks
              • RuntimeRadios
              • RuntimeRectangle
              • RuntimeRtfArea
              • RuntimeSpinner
              • RuntimeSplitPane
              • RuntimeTabPanel
              • RuntimeTextArea
              • RuntimeTextField
              • RuntimeWebComponent
        • JS Lib
          • Array
          • BigInt
          • Boolean
          • Date
          • Function
          • IterableValue
          • Iterator
          • JSON
          • Map
          • Set
          • Math
          • Namespace
          • Number
          • Object
          • Promise
          • QName
          • RegExp
          • Special Operators
          • Statements
          • String
          • XML
          • XMLList
        • Application
          • APPLICATION_TYPES
          • CLIENTDESIGN
          • DRAGNDROP
          • ELEMENT_TYPES
          • LOGGINGLEVEL
          • NGCONSTANTS
          • UICONSTANTS
          • CSSPosition
          • JSDimension
          • JSDNDEvent
          • JSEvent
          • JSLogger
          • JSLogBuilder
          • JSPoint
          • JSUpload
          • JSWindow
          • JSBounds
          • Renderable
          • UUID
        • SolutionModel
          • ALIGNMENT
          • ANCHOR
          • BEVELTYPE
          • CURSOR
          • DEFAULTS
          • FONTSTYLE
          • MEDIAOPTION
          • PAGEORIENTATION
          • PRINTSLIDING
          • SCROLLBAR
          • TITLEJUSTIFICATION
          • TITLEPOSITION
          • UNITS
          • JSBean
          • JSButton
          • JSCalculation
          • JSComponent
          • JSDataSourceNode
          • JSField
          • JSForm
          • JSLabel
          • JSMedia
          • JSMethod
          • JSPart
          • JSPortal
          • JSRelation
          • JSRelationItem
          • JSStyle
          • JSTab
          • JSTabPanel
          • JSValueList
          • JSVariable
          • JSTitle
          • JSChecks
          • JSCombobox
          • JSHeader
          • JSInsetList
          • JSList
          • JSPassword
          • JSRadios
          • JSText
          • JSTextArea
          • JSWebComponent
          • JSLayoutContainer
        • Database Manager
          • QUERY_COLUMN_TYPES
          • SQL_ACTION_TYPES
          • JSColumn
          • JSDataSet
          • JSBaseRecord
          • JSBaseSqlRecord
          • JSBaseFoundset
          • JSBaseSQLFoundset
          • JSFoundSet
          • JSFoundSetUpdater
          • JSRecord
          • JSRecordMarker
          • JSRecordMarkers
          • JSTable
          • JSTableFilter
          • MenuFoundSet
          • MenuItemRecord
          • QBAggregate
          • QBAggregates
          • QBCase
          • QBCaseWhen
          • QBColumn
          • QBColumns
          • QBCondition
          • QBFunction
          • QBFunctions
          • QBGroupBy
          • QBJoin
          • QBJoins
          • QBLogicalCondition
          • QBParameter
          • QBParameters
          • QBPart
          • QBResult
          • QBSearchedCaseExpression
          • QBSelect
          • QBSort
          • QBSorts
          • QBTableClause
          • QBWhereCondition
          • ViewFoundSet
          • ViewRecord
        • Events Manager
          • EVENTS_AGGREGATION_TYPES
          • EventType
        • Menus
          • JSMenu
          • JSMenuItem
        • JSMenuDatasource
        • Utils
        • Client Utils
          • JSBlobLoaderBuilder
        • History
        • Security
        • i18n
        • ServoyException
          • DataException
        • JSUnit
        • Datasources
          • DBDataSource
          • DBDataSourceServer
          • JSConnectionDefinition
          • JSDataSource
          • MemDataSource
          • MenuDataSource
          • SPDataSource
          • SPDataSourceServer
          • ViewDataSource
        • JSViewDatasource
        • servoyDeveloper
        • enum
    • Extensions
      • UI Components
        • Buttons and Text
          • Badge
          • Button
          • Data Label
          • Drop Down
          • Image
          • Label
        • Form Containers
          • Accordion Panel
          • Collapse
          • Form Container
          • Form Component Container
          • List Form Component
          • Default Loading Indicator
          • Error Bean
          • Portal
          • Responsive Container
          • Servoy Default Navigator
          • Slider
          • Split Pane
          • TabPanel
        • Grids
          • Data Grid
          • Power Grid
          • Table
        • Input Controls
          • Calendar
          • Calendar Inline
          • Checkbox
          • Choice Group
          • Combobox
          • Floatinglabel Calendar
          • Floatinglabel Combobox
          • Floatinglabel Textarea
          • Floatinglabel Textbox
          • Floatinglabel Type Ahead
          • Group Buttons
          • Html Area
          • Input Group
          • Rating
          • Select2tokenizer
          • Slider
          • Spinner
          • Switch
          • TextArea
          • TextBox
          • TextBox Group
          • Type Ahead
        • Media
          • Carousel
          • Embedded YouTube
          • File upload
          • Image label
          • Lightbox Gallery
          • MultiFile Upload
          • PDF JS Viewer
          • PDF Viewer
        • Mobile
          • Native Data List
          • Native Select
        • Navigation
          • Breadcrumbs
          • Navbar
          • sidenav
        • SmartDocEditor
          • Smart Document Editor
        • Visualization
          • Canvas
          • Chart
          • Custom List
          • DBTreeview
          • Foundset List
          • Fullcalendar
          • Gauge
          • Google Maps
          • Kanban
          • Progress Bar
          • Treeview
      • Server Plugins
        • amortization
          • AmortizationCalculation
          • Polynomial
        • clientmanager
          • Broadcaster
          • JSClientInformation (cm)
        • excelxport
        • file
          • JSFile
          • JSProgressMonitor
        • headlessclient
          • JSClient
        • http
          • HTTP_STATUS
          • Cookie
          • DeleteRequest
          • GetRequest
          • HeadRequest
          • HttpClient
          • HttpClientConfig
          • OptionsRequest
          • PostRequest
          • PutRequest
          • Response
          • TraceRequest
          • PatchRequest
          • JSFileUpload
        • images
          • JSImage
        • jwt
          • Algorithm
          • Builder
          • JWTClaims
        • mail
          • Attachment
          • MailMessage
        • maintenance
          • JSClientInformation
          • JSColumnObject
          • JSServer
          • JSTableObject
        • mobileservice
          • OfflineDataDescription
        • oauth
          • ClientAuthentication
          • CustomApiBuilder
          • OAuthProviders
          • OAuthRequest
          • OAuthResponse
          • OAuthResponseBinary
          • OAuthResponseJSON
          • OAuthResponseText
          • OAuthService
          • OAuthServiceBuilder
          • OAuthTokenExtractors
          • RequestType
        • pdf_output
        • rawSQL
        • RestWs plugin
        • rest_ws
          • WsContents
          • WsCookie
          • WsRequest
          • WsResponse
        • scheduler
        • serialize
        • textxport
          • DataProviderExport
          • TabExporter
        • udp
          • JSPacket
        • XmlReader
          • XmlNode
      • Browser Plugins
        • Block UI
        • Block UI (ref)
        • Dialogs Plugin
        • Idle
        • Idle (ref)
        • Key Listener
        • Key Listener (ref)
        • NGDesktop File
        • NGDesktop File (ref)
        • NGDesktop UI (ref)
        • NGDesktop Utils (ref)
        • NG Utils (ref)
        • Office Javascript API for Servoy
        • Phonegap
        • Web Notifications (Native)
        • Web Notifications (Toastr)
        • Window Plugin
        • Font Awesome
      • Modules
        • Smart Doc Editor Utils
        • svyAPI
          • Getting Started
        • svyLookup
          • Custom Templates
          • API Documentation
          • svyLookup v1
            • API Documentation v1.0.0
            • Base Form svyLookupTable v1.0.0
            • Base Form AbstractLookup v1.0.0
        • svyLookupExample
        • svyNavigation
          • API Documentation
            • API svyNavigation
            • API svyNavigationHistory
            • API svyNavigationUX
        • svyNavigationUX
        • svyNavigationUXSample
        • svyPopupFilter
          • Simple Filter Pickers
          • Custom Templates
          • API Documentation
            • API svyToolbarFilter
            • API svyPopupFilter
          • API Documentation v1
            • API svyToolbarFilter v1
            • API svyPopupFilter v1
        • svyProperties
        • svySearch
        • svySecurity
          • Overview
          • Token-based Auth and SSO (NEW!)
          • API Documentation
          • Getting Started
          • Tenant replication
          • Security Management Console
            • Classic Security Management Console
          • svySecurityUX
          • svyProperties
          • API Doc svyProperties
        • svySecurityConsole
        • svySecurityUX
        • svyUtils
          • Log Manager
          • Log Manager Appenders
          • Smart Doc Editor Utils
          • Custom Dialogs
          • Excel Utils
          • Full API Reference
          • Crypto Utils
        • svyUtils$Excel
        • svyUtils$NGClient
        • svyUtils$customDialogs
        • svyUtils$logManagerAppenders
        • svyUtils$tableGrid
      • Layout
        • Boostrap 12grid layout
          • Collapsible Container
          • Simple Collapsible
          • Center Container
          • Inline Group Container
          • Flexbox Layout
      • Solutions
        • Sample Application
          • Tutorial Part 1
          • Tutorial Part 2
      • Packages
        • UI Component Packages
          • Advanced Renderers
          • Bootstrap Components
          • Bootstrap Extra Components
          • Canvas
          • Chart JS
          • Fullcalendar Component
          • googlemaps
          • kanban
          • Servoy Core
          • Servoy Extra Components
          • Servoy NG-Grids
          • Servoy PDF Viewer
          • smartDocumentEditor
        • Browser Plugin Packages
          • Block UI
          • Core NG only Services
          • Key Listener
          • NGDesktop File
          • NGDesktop UI
          • NGDesktop Utils
          • Web Notifications
          • Idle Web Service
    • Servoy Developer
      • Menu
        • File
        • Edit
        • Source
        • Refactor
        • Navigate
        • Search
        • Project
        • Actions
        • Run
        • Window
        • Help
      • Toolbar
      • Solution Explorer
        • Resources
          • Database Servers
            • Database Server
              • Procedures
              • Tables
              • Views
          • Security
          • i18n
        • All Solutions
          • Solution
          • Active Solution
            • Scopes
              • Scope
                • Variables
            • Forms
              • Working Set
              • Form
                • Controller
                • Variables
                • Elements
                • Relations
            • Form Components
              • Form Component
            • Relations
              • Relation
            • ValueLists
              • ValueList
            • Menus
              • Menu
                • MenuItem
            • Media
              • Folder
              • File
            • DataSources
              • In Memory DataSources
                • In Memory DataSource
              • View Foundsets DataSources
                • View Foundset DataSources
            • Servoy Packages
              • Package
            • Modules
              • Module
        • Solution Explorer Contextual List
      • Views
        • Command Console
        • Console
        • Problems
        • Tasks
        • Bookmarks
        • Search
        • Form Hierarchy
        • Help
        • JUnit
        • Outline
        • Profiler
        • Properties
        • Project Explorer
        • Call Hierarchy
      • Editors and Wizards
        • Property configurator for columns
        • Relation Editor
        • Text Format Editor
        • Date Format Editor
        • Number Format Editor
        • Database Synchronization Wizard
        • Security Editor
        • SQL Editor
        • i18n Editor
        • File Import Wizard
        • File Export Wizard
        • WAR Export Wizard
        • NGDesktop Export Wizard
        • Table Editor
        • Metadata Synchronization Wizard
        • Database Server Connection Editor
        • Text Property Editor
        • Valuelist Editor
        • Form Editor
          • Parts of the Form Editor
          • Designing a Form
          • Layout Tools
          • Using Containers
          • Creating and Using Forms
          • Using Servoy Beans
          • Using Shapes
          • Form Editor Subtabs
          • [Tips and Shortcuts][reference/servoy-developer/object-editors/form-editor-tips_and_shortcuts.md]
          • Editong a Responsive LayoutForm
          • CSS Positioning
        • Form Hierarchy
        • Component Properties Editor
        • Variable Editor
        • Method Selection Wizard
        • New Solution Wizard
        • Application Event Types Editor
        • New Form Wizard
        • Form Dataproviders Configurator
        • Servoy Resource Locator
        • Datasource Selection Wizard
        • Sorting Fields Wizard
        • Scripting Editor
          • Getting Started-Overview of Script Editor
          • Code Writing Features
          • Code Navigation
          • Code Rewriting Tools
          • Refactoring
          • Code Formatting
          • Script Editor Tips and Shortcuts
          • Unit Tests
        • Theme Editor
          • General Properties
          • Sidenav Properties
          • Navbar Properties
          • Tabs Properties
          • Windows Properties
          • Dialogs Properties
          • Tables Properties
          • Breadcrumb specific style Properties
          • Brand colors Properties
          • Validations Properties
          • Margins and Padding Properties
        • Editor Selection
        • Run Configurations
        • Debug Configurations
        • Externalize Strings Wizard
        • Font Chooser Wizard
        • Color Chooser Wizard
        • Project Properties Configurator
        • Move Wizard
        • External Tools Configurations
        • About Servoy Developer
        • Servoy Developer Installation Details
        • Eclipse Marketplace Wizard
        • Install Available Software Wizard
        • Cheat Sheet Selection Wizard
        • Servoy Developer Help Wizard
        • Switch to Editor Wizard
        • Find Actions Wizard
        • Customize Perspective Configurator
        • Quick Search Wizard
        • Search Wizard
        • Encoding Wizard
        • Task Wizard
        • Find - Replace Wizard
        • Properties Editor
        • New Project Wizard
        • New Method Wizard
        • New Menu Wizard
          • New MenuItem Wizard
        • Menu Editor
        • ServoyMenu Selection Wizard
        • JSMenu compatible component selector
        • Permissions Configuration Dialog
      • Project File Structure
        • Servoy Installation Directory
          • servoy.properties
        • Workspace Folder
          • Resources Directory
            • Database Information (.dbi) Files
          • Solution Folder
      • Package Manager
      • Preferences
      • Property Types for components / services
      • Debugger
        • Debug Explorer
        • Breakpoints
          • Breakpoint Properties
        • Variables
        • Expressions
        • Interactive Console
    • Application Server
    • Servoy Cloud
      • Cloud Control Center
        • Home
          • Setup Namespace
          • User profile
            • My Profile
            • Support
        • Download IDE
        • Application Overview
          • Applications
            • Pipelines
              • Jobs
                • Packages
                  • Commits
                  • Artifacts
                  • Configuration
                  • Quality reports
                  • Build markers
                • Job Configuration
                  • Build and Deploy or Build
                  • Mobile
                  • Desktop
            • Environments
              • Metrics
                • Users
                • Databases
                  • Metrics
                • System Health
                • Log Activity
                • App performance
                • Query performance
              • Cloud reporting
            • Security
              • Permissions
              • Tenants
            • Reports
            • Security Login Designer
              • Single Sign-On
                • Sign in with Google
                • Sign in with Microsoft
          • Code Repositories
        • Project Management
          • Tickets
          • Backlog
          • Active Sprints
        • User Management
          • Users
          • Roles
        • Administration
          • Security
            • ServoyCloud Roles
          • Credentials
          • Settings
        • Add-Ons
      • Database Backup
      • E2E Cypress Testing
        • Using Cypress
      • On-Premise Deployment
      • Privacy policy (ServoyAI)
      • FAQ
      • Migrate to Servoy Cloud
    • Extensions Developement
      • Component and Services
        • Component Development
        • Service Development
        • Tools and Dev Tips to use for Component/Service developement
        • Manifest (.mf file)
        • Specification (.spec file)
          • Property Types
            • Array property types
            • Custom object property types
            • Findmode property type
            • Foundset property type
            • Tags
        • Directives And Filters
          • Sablotabsequence
        • Console (serverside)
        • ServoyApi (serverside)
      • Serverside Plugins
        • Data Convertors and Validators
        • UI Convertors
  • Release notes
    • Release notes
      • 2025.03
      • 2024.03 (LTS)
      • 2023.03 (LTS)
      • 2025.03 (Servoy Cloud)
      • 2024.12
      • 2024.12 (Servoy Cloud)
      • 2024.09
      • 2024.09 (Servoy Cloud)
      • 2024.06
      • 2024.06 (Servoy Cloud)
      • 2024.03 (Servoy Cloud)
      • 2023.12
      • 2023.12 (Servoy Cloud)
      • 2023.09
      • 2023.09 (Servoy Cloud)
      • 2023.06
      • 2022.03 (LTS)
      • 2022.12 What's new
      • 2022.12
      • 2022.09 What's new
      • 2022.09
      • 2022.06 What's new
      • 2022.06
      • 2021.03.3 (LTS)
Powered by GitBook
On this page
  • Overview
  • Constants Summarized
  • Methods Summarized
  • Constants Detailed
  • ACCESSIBLE
  • DELETE
  • INSERT
  • READ
  • TRACKING
  • TRACKING_VIEWS
  • UPDATE
  • VIEWABLE
  • Methods Detailed
  • addPermissionToUser(a_userUID, permission)
  • authenticate(authenticator_solution, method)
  • authenticate(authenticator_solution, method, credentials)
  • canAccess(formName)
  • canAccess(formName, elementName)
  • canDelete(dataSource)
  • canInsert(dataSource)
  • canRead(dataSource)
  • canUpdate(dataSource)
  • canView(formName)
  • canView(formName, elementName)
  • changeUserName(a_userUID, username)
  • checkPassword(a_userUID, password)
  • createUser(username, password)
  • createUser(username, password, userUID)
  • deleteUser(userUID)
  • getClientID()
  • getElementUUIDs(formname)
  • getPermissions()
  • getPermissions(userUID)
  • getSystemUserName()
  • getTenantValue()
  • getUserName()
  • getUserName(userUID)
  • getUserPermissions()
  • getUserUID()
  • getUserUID(username)
  • getUsers()
  • getUsers(groupName)
  • hasPermission(permisson)
  • hasPermission(permission, userUID)
  • login(username, a_userUID, permissions)
  • logout()
  • logout(solutionToLoad)
  • logout(solutionToLoad, argument)
  • logout(solutionToLoad, method)
  • logout(solutionToLoad, method, argument)
  • removePermissionFromUser(a_userUID, permission)
  • setPassword(a_userUID, password)
  • setSecuritySettings(dataset)
  • setTenantValue(value)
  • setUserUID(a_userUID, newUserUID)

Was this helpful?

  1. Reference
  2. Servoy Core
  3. Developer API

Security

PreviousHistoryNexti18n

Last updated 5 months ago

Was this helpful?

(security)

Overview

The security object provides a comprehensive API for managing users, groups, and permissions in a solution. It includes constants for form and table security and methods to control user access and permissions programmatically.

Security constants such as ACCESSIBLE, DELETE, INSERT, READ, and UPDATE define flags for controlling access to forms and tables. These constants allow developers to set permissions using datasets and apply them at runtime.

The API includes methods for managing users, such as createUser, deleteUser, and changeUserName. Permissions can be assigned or removed with addPermissionToUser and removePermissionFromUser. Developers can query permissions using methods like hasPermission or retrieve user-related information with getUserName and getUserUID.

Authentication is supported via the authenticate method, which integrates with custom authenticators or Servoy's built-in system. The API also allows setting and managing tenant values to filter data access by tenant.

The security object facilitates dynamic security configurations and provides control over application access at a granular level.

For more information, please refer to the overall documentation.

Constants Summarized

Type
Name
Summary

Constant representing the accessible flag for form security.

Constant representing the delete flag for table security.

Constant representing the insert flag for table security.

Constant representing the read flag for table security.

Constant representing the tracking flag for table security (tracks sql insert/update/delete).

Constant representing the tracking flag for table security (tracks sql select).

Constant representing the update flag for table security.

Constant representing the viewable flag for form security.

Methods Summarized

Type
Name
Summary

Gives a user a permission Note: this method can only be called by an admin.

Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.

Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.

Returns whether form is accessible.

Returns whether element from form is accessible.

Returns a boolean value for security rights.

Returns a boolean value for security rights.

Returns a boolean value for security rights.

Returns a boolean value for security rights.

Returns whether form is viewable.

Returns whether element from form is viewable.

Changes the username of the specified userUID.

Returns true if the password for that userUID is correct, else false.

Creates a new user, returns new uid (or null when permission couldn't be created or user alreay exist).

Creates a new user, returns new uid (or null when permission couldn't be created or user alreay exist).

Deletes an user.

Returns the client ID.

Returns the form elements UUID's as dataset, the one with no name is the form itself.

Get all the permissions of the solution (returns a dataset).

Get all the permissions for given user UID.

Retrieves the username of the currently logged in user on operating system level.

Retrieve the tenant value for this Client, this value will be used as the value for all tables that have a column marked as a tenant column.

Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.

Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.

Get all the permissions of the current user.

Get the current user UID (null if not logged in); finds the userUID for given user_name if passed as parameter.

Get the current user UID (null if not logged in); finds the userUID for given user_name if passed as parameter.

Get all the users in the security settings (returns a dataset).

Get all the users in the security settings (returns a dataset).

Check if the current user has the given permission

Check if the given user has the given permission

Login to be able to leave the solution loginForm.

void

Logout the current user and close the solution, if the solution requires authentication and user is logged in.

void

Logout the current user and close the solution, if the solution requires authentication and user is logged in.

void

Logout the current user and close the solution, if the solution requires authentication and user is logged in.

void

Logout the current user and close the solution, if the solution requires authentication and user is logged in.

void

Logout the current user and close the solution, if the solution requires authentication and user is logged in.

Removes an permission from a user.

Set a new password for the given userUID.

void

Sets the security settings; the entries contained in the given dataset will override those contained in the current security settings.

void

Set the tenant value for this Client, this value will be used as the value for all tables that have a column marked as a tenant column.

Set a new userUID for the given userUID.

Constants Detailed

ACCESSIBLE

Constant representing the accessible flag for form security.

Sample

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

DELETE

Constant representing the delete flag for table security.

Sample

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

INSERT

Constant representing the insert flag for table security.

Sample

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

READ

Constant representing the read flag for table security.

Sample

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

TRACKING

Constant representing the tracking flag for table security (tracks sql insert/update/delete).

Sample

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

TRACKING_VIEWS

Constant representing the tracking flag for table security (tracks sql select).

Sample

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

UPDATE

Constant representing the update flag for table security.

Sample

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

VIEWABLE

Constant representing the viewable flag for form security.

Sample

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

Methods Detailed

addPermissionToUser(a_userUID, permission)

Gives a user a permission Note: this method can only be called by an admin.

Parameters

Sample

var userUID = security.getUserUID();
security.addPermissionToUser(userUID, 'permission');

authenticate(authenticator_solution, method)

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.

Parameters

Sample

// 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])

authenticate(authenticator_solution, method, credentials)

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.

Parameters

Sample

// 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])

canAccess(formName)

Returns whether form is accessible.

security.canAccess(formName)

Parameters

canAccess(formName, elementName)

Returns whether element from form is accessible.

security.canAccess(formName,elementName)

Parameters

canDelete(dataSource)

Returns a boolean value for security rights.

Parameters

Sample

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);

canInsert(dataSource)

Returns a boolean value for security rights.

Parameters

Sample

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);

canRead(dataSource)

Returns a boolean value for security rights.

Parameters

Sample

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);

canUpdate(dataSource)

Returns a boolean value for security rights.

Parameters

Sample

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);

canView(formName)

Returns whether form is viewable.

security.canView(formName)

Parameters

canView(formName, elementName)

Returns whether element from form is viewable.

security.canView(formName,elementName)

Parameters

changeUserName(a_userUID, username)

Changes the username of the specified userUID. Note: this method can only be called by an admin user or a normal logged in user changing its own userName.

Parameters

Sample

if(security.changeUserName(security.getUserUID('name1'), 'name2'))
{
	application.output('Username changed');
}

checkPassword(a_userUID, password)

Returns true if the password for that userUID is correct, else false.

Parameters

Sample

if(security.checkPassword(security.getUserUID(), 'password1'))
{
	security.setPassword(security.getUserUID(), 'password2')
}
else
{
	application.output('wrong password')
}

createUser(username, password)

Creates a new user, returns new uid (or null when permission couldn't be created or user alreay exist). Note: this method can only be called by an admin.

Parameters

Sample

var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the permissions
	var set = security.getPermissions();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the permission
		application.output(set.getValue(p, 2));
		// add permission to user
		security.addPermissionToUser(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the permissions
	if(!removeUser)
	{
		// get now all the permissions that that users has (all if above did go well)
		var set =security.getPermissions(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the permission
			application.output(set.getValue(p, 2));
			// remove permission from user
			security.removePermissionFromUser(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the permissions)
		security.deleteUser(uid);
	}
}

createUser(username, password, userUID)

Creates a new user, returns new uid (or null when permission couldn't be created or user alreay exist). Note: this method can only be called by an admin.

Parameters

Sample

var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the permissions
	var set = security.getPermissions();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the permission
		application.output(set.getValue(p, 2));
		// add permission to user
		security.addPermissionToUser(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the permissions
	if(!removeUser)
	{
		// get now all the permissions that that users has (all if above did go well)
		var set =security.getPermissions(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the permission
			application.output(set.getValue(p, 2));
			// remove permission from user
			security.removePermissionFromUser(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the permissions)
		security.deleteUser(uid);
	}
}

deleteUser(userUID)

Deletes an user. returns true if no error was reported. Note: this method can only be called by an admin.

Parameters

Sample

var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the permissions
	var set = security.getPermissions();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the permission
		application.output(set.getValue(p, 2));
		// add permission to user
		security.addPermissionToUser(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the permissions
	if(!removeUser)
	{
		// get now all the permissions that that users has (all if above did go well)
		var set =security.getPermissions(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the permission
			application.output(set.getValue(p, 2));
			// remove permission from user
			security.removePermissionFromUser(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the permissions)
		security.deleteUser(uid);
	}
}

getClientID()

Returns the client ID.

Sample

var clientId = security.getClientID()

getElementUUIDs(formname)

Returns the form elements UUID's as dataset, the one with no name is the form itself.

Parameters

Sample

var formElementsUUIDDataSet = security.getElementUUIDs('orders_form');

getPermissions()

Get all the permissions of the solution (returns a dataset). first id column is deprecated!, use only the permission name column.

Sample

var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the permissions
	var set = security.getPermissions();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the permission
		application.output(set.getValue(p, 2));
		// add permission to user
		security.addPermissionToUser(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the permissions
	if(!removeUser)
	{
		// get now all the permissions that that users has (all if above did go well)
		var set =security.getPermissions(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the permission
			application.output(set.getValue(p, 2));
			// remove permission from user
			security.removePermissionFromUser(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the permissions)
		security.deleteUser(uid);
	}
}

getPermissions(userUID)

Get all the permissions for given user UID.

Parameters

Sample

//get all the users in the security settings (Returns a JSDataset)
var dsUsers = security.getUsers()

//loop through each user to get their permissions
//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 permissions for the current user
	/** @type {JSDataSet} */
	var p = security.getPermissions(dsUsers.getValue(i,1));

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "permission" and the permission(s)
		//the user has
		application.output("permission: " + p.getValue(k,2));
	}
}

getSystemUserName()

Retrieves the username of the currently logged in user on operating system level.

Sample

//gets the current os username
var osUserName = security.getSystemUserName();

getTenantValue()

Retrieve the tenant value for this Client, this value will be used as the value for all tables that have a column marked as a tenant column. This results in adding a table filter for that table based on that column and the this value.

A client with tenant value will only receive databroadcasts from other clients that have no or a common tenant value set Be sure to not access or depend on records having different tenant values, as no databroadcasts will be received for those

getUserName()

Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.

Sample

//gets the current loggedIn username
var userName = security.getUserName();

getUserName(userUID)

Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.

Parameters

Sample

//gets the current loggedIn username
var userName = security.getUserName();

getUserPermissions()

Get all the permissions of the current user.

Sample

//set p to the user permissions for the current user
	/** @type {JSDataSet} */
	var p = security.getUserPermissions();

	for(k=1;k<=p.getMaxRowIndex();k++)
	{
		//print to the output debugger tab: "permission" and the permissons(s)
		//the user has
		application.output("permission: " + p.getValue(k,2));
	}

getUserUID()

Get the current user UID (null if not logged in); finds the userUID for given user_name if passed as parameter.

Sample

//gets the current loggedIn username
var userName = security.getUserName();
//gets the uid of the given username
var userUID = security.getUserUID(userName);
//is the same as above
//var my_userUID = security.getUserUID();

getUserUID(username)

Get the current user UID (null if not logged in); finds the userUID for given user_name if passed as parameter.

Parameters

Sample

//gets the current loggedIn username
var userName = security.getUserName();
//gets the uid of the given username
var userUID = security.getUserUID(userName);
//is the same as above
//var my_userUID = security.getUserUID();

getUsers()

Get all the users in the security settings (returns a dataset).

getUsers(groupName)

Get all the users in the security settings (returns a dataset).

Parameters

hasPermission(permisson)

Check if the current user has the given permission

Parameters

Sample

//check whatever user is part of the Administrators permission
if(security.hasPermission('Administrators'))
{
	// do administration stuff
}

hasPermission(permission, userUID)

Check if the given user has the given permission

Parameters

Sample

//check whatever user is part of the Administrators permission
if(security.hasPermission('Administrators', security.getUserUID('admin')))
{
	// do administration stuff
}

login(username, a_userUID, permissions)

Login to be able to leave the solution loginForm.

Example: Permissions 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.

Parameters

Sample

var permissions = ['Administrators']; //normally these groups are for example received from LDAP
var user_uid = scopes.globals.email; //also this uid might be received from external authentication method
var ok =  security.login(scopes.globals.username, user_uid , permissions)
if (!ok)
{
	plugins.dialogs.showErrorDialog('Login failure',  'Already logged in? or no user_uid/permissions specified?', 'OK')
}

logout()

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().

Returns: void

Sample

//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');//log out, close current solution, open solution 'solution_name' and call global method 'global_method_name' of the newly opened solution
//security.logout('solution_name','global_method_name','my_string_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//security.logout('solution_name','global_second_method_name',2);
//security.logout('solution_name', {a: 'my_string_argument', p1: 'param1', p2: 'param2'});//log out, close current solution, open solution 'solution_name', call (login) solution's onOpen with argument 'my_argument' and queryParams p1,p2
//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 )

logout(solutionToLoad)

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().

Parameters

Returns: void

Sample

//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');//log out, close current solution, open solution 'solution_name' and call global method 'global_method_name' of the newly opened solution
//security.logout('solution_name','global_method_name','my_string_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//security.logout('solution_name','global_second_method_name',2);
//security.logout('solution_name', {a: 'my_string_argument', p1: 'param1', p2: 'param2'});//log out, close current solution, open solution 'solution_name', call (login) solution's onOpen with argument 'my_argument' and queryParams p1,p2
//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 )

logout(solutionToLoad, argument)

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().

Parameters

Returns: void

Sample

//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');//log out, close current solution, open solution 'solution_name' and call global method 'global_method_name' of the newly opened solution
//security.logout('solution_name','global_method_name','my_string_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//security.logout('solution_name','global_second_method_name',2);
//security.logout('solution_name', {a: 'my_string_argument', p1: 'param1', p2: 'param2'});//log out, close current solution, open solution 'solution_name', call (login) solution's onOpen with argument 'my_argument' and queryParams p1,p2
//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 )

logout(solutionToLoad, method)

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().

Parameters

Returns: void

Sample

//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');//log out, close current solution, open solution 'solution_name' and call global method 'global_method_name' of the newly opened solution
//security.logout('solution_name','global_method_name','my_string_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//security.logout('solution_name','global_second_method_name',2);
//security.logout('solution_name', {a: 'my_string_argument', p1: 'param1', p2: 'param2'});//log out, close current solution, open solution 'solution_name', call (login) solution's onOpen with argument 'my_argument' and queryParams p1,p2
//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 )

logout(solutionToLoad, method, argument)

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().

Parameters

Returns: void

Sample

//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');//log out, close current solution, open solution 'solution_name' and call global method 'global_method_name' of the newly opened solution
//security.logout('solution_name','global_method_name','my_string_argument');//log out, close current solution, open solution 'solution_name', call global method 'global_method_name' with argument 'my_argument'
//security.logout('solution_name','global_second_method_name',2);
//security.logout('solution_name', {a: 'my_string_argument', p1: 'param1', p2: 'param2'});//log out, close current solution, open solution 'solution_name', call (login) solution's onOpen with argument 'my_argument' and queryParams p1,p2
//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 )

removePermissionFromUser(a_userUID, permission)

Removes an permission from a user. Note: this method can only be called by an admin.

Parameters

Sample

var removeUser = true;
//create a user
var uid = security.createUser('myusername', 'mypassword');
if (uid) //test if user was created
{
	// Get all the permissions
	var set = security.getPermissions();
	for(var p = 1 ; p <= set.getMaxRowIndex() ; p++)
	{
		// output name of the permission
		application.output(set.getValue(p, 2));
		// add permission to user
		security.addPermissionToUser(uid, set.getValue(p,2));
	}
	// if not remove user, remove user from all the permissions
	if(!removeUser)
	{
		// get now all the permissions that that users has (all if above did go well)
		var set =security.getPermissions(uid);
		for(var p = 1;p<=set.getMaxRowIndex();p++)
		{
			// output name of the permission
			application.output(set.getValue(p, 2));
			// remove permission from user
			security.removePermissionFromUser(uid, set.getValue(p,2));
		}
	}
	else
	{
		// delete the user (the user will be removed from the permissions)
		security.deleteUser(uid);
	}
}

setPassword(a_userUID, password)

Set a new password for the given userUID. Note: this method can only be called by an admin user or a normal logged in user changing its own password.

Parameters

Sample

if(security.checkPassword(security.getUserUID(), 'password1'))
{
	security.setPassword(security.getUserUID(), 'password2')
}
else
{
	application.output('wrong password')
}

setSecuritySettings(dataset)

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.

Parameters

Returns: void

Sample

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

setTenantValue(value)

Set the tenant value for this Client, this value will be used as the value for all tables that have a column marked as a tenant column. This results in adding a table filter for that table based on that column and the given value, using JSTableFilter.dataBroadcast(true).

When creating a new record, this value will be auto filled in for all the columns that are marked as a tenant column. If you give an array of values then the first array value is used for this.

When a tenant value is set the client will only receive databroadcasts from other clients that have no or a common tenant value set. If the tenant value is a list then the broadcast will be filtered only if there is single element match between the 2 list, so ['a','b'] will match ['a','c'] but not ['c','d'], the actual data of a recod is ignored for this. Be sure to not access or depend on records having different tenant values, as no databroadcasts will be received for those

Parameters

Returns: void

setUserUID(a_userUID, newUserUID)

Set a new userUID for the given userUID. Note: this method can only be called by an admin.

Parameters


Type

Type

Type

Type

Type

Type

Type

Type

a_userUID the user UID to be added

permission the permission to add to

Returns: true if added

authenticator_solution authenticator solution installed on the Servoy Server, null for servoy built-in authentication

method authenticator method, null for servoy built-in authentication

Returns: authentication result from authenticator solution or boolean in case of servoy built-in authentication

authenticator_solution authenticator solution installed on the Servoy Server, null for servoy built-in authentication

method authenticator method, null for servoy built-in authentication

credentials array whose elements are passed as arguments to the authenticator method, in case of servoy built-in authentication this should be [username, password]

Returns: authentication result from authenticator solution or boolean in case of servoy built-in authentication

formName form name

Returns: true if accessible

formName form name

elementName element name from specified form

Returns: true if accessible

dataSource the datasource

Returns: true if allowed

dataSource the datasource

Returns: true if allowed

dataSource the datasource

Returns: true if allowed

dataSource the datasource

Returns: true if allowed

formName form name

Returns: true if viewable

formName form name

elementName element name from specified form

Returns: true if viewable

a_userUID the userUID to work on

username the new username

Returns: true if changed

a_userUID the userUID to check the password for

password the new password

Returns: true if password oke

username the username

password the user password

Returns: the userUID the created userUID, will be same if provided

username the username

password the user password

userUID the user UID to use

Returns: the userUID the created userUID, will be same if provided

userUID The UID of the user to be deleted.

Returns: true if the user is successfully deleted.

Returns: the clientId as seen on the server admin page

formname the formname to retieve the dataset for

Returns: dataset with element info

Returns: dataset with all the groups

userUID to retrieve the user permissions

Returns: dataset with permissions names

Returns: the os user name

Returns: An array of tenant values for this client.

Returns: the user name

userUID the user UID used to retrieve the name

Returns: the user name

Returns: dataset with permissions

Returns: the userUID

username the username to find the userUID for

Returns: the userUID

Returns: dataset with all the users

groupName the group to filter on

Returns: dataset with all the users

permisson name of the permission

Returns: true if it has the given permission

permission name of the permission to check

userUID UID of the user to check

Returns: true if it has that given permission

username the username, like 'JamesWebb'

a_userUID the user UID to process login for

permissions the permissions array

Returns: true if loggedin

solutionToLoad the solution to load after logout

solutionToLoad the solution to load after logout

argument the argument to pass to the (login) solution onOpen

solutionToLoad the solution to load after logout

method the method to run in the solution to load

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

a_userUID the user UID to be removed

permission the permission to remove from

Returns: true if removed

a_userUID the userUID to set the new password for

password the new password

Returns: true if changed

dataset the dataset with security settings

value a single tenant value or an array of tenant values to filter tables having a column flagged as Tenant column by.

a_userUID the userUID to set the new user UID for

newUserUID the new user UID

Returns: true if changed

Security
Number
Number
Number
Number
Number
Number
Number
Number
Object
Object
Boolean
String
String
Object
String
String
Array
Object
String
Boolean
String
String
Boolean
String
Boolean
String
Boolean
String
Boolean
String
Boolean
String
Boolean
String
String
Boolean
Object
String
Boolean
Object
String
Boolean
String
String
Object
String
String
Object
Object
Object
Boolean
String
String
JSDataSet
JSDataSet
Object
JSDataSet
String
Array
String
Object
String
JSDataSet
String
String
String
JSDataSet
String
JSDataSet
String
Boolean
String
Object
Boolean
String
Object
Array
Boolean
String
String
Object
String
String
String
String
Object
Object
Object
Boolean
Object
String
Boolean
Object
Object
Object
String
Boolean
Number
Number
Number
Number
Number
Number
Number
Number
Boolean
Object
Object
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Object
Object
Boolean
String
JSDataSet
JSDataSet
JSDataSet
String
Array
String
String
JSDataSet
String
String
JSDataSet
JSDataSet
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
ACCESSIBLE
DELETE
INSERT
READ
TRACKING
TRACKING_VIEWS
UPDATE
VIEWABLE
addPermissionToUser(a_userUID, permission)
authenticate(authenticator_solution, method)
authenticate(authenticator_solution, method, credentials)
canAccess(formName)
canAccess(formName, elementName)
canDelete(dataSource)
canInsert(dataSource)
canRead(dataSource)
canUpdate(dataSource)
canView(formName)
canView(formName, elementName)
changeUserName(a_userUID, username)
checkPassword(a_userUID, password)
createUser(username, password)
createUser(username, password, userUID)
deleteUser(userUID)
getClientID()
getElementUUIDs(formname)
getPermissions()
getPermissions(userUID)
getSystemUserName()
getTenantValue()
getUserName()
getUserName(userUID)
getUserPermissions()
getUserUID()
getUserUID(username)
getUsers()
getUsers(groupName)
hasPermission(permisson)
hasPermission(permission, userUID)
login(username, a_userUID, permissions)
logout()
logout(solutionToLoad)
logout(solutionToLoad, argument)
logout(solutionToLoad, method)
logout(solutionToLoad, method, argument)
removePermissionFromUser(a_userUID, permission)
setPassword(a_userUID, password)
setSecuritySettings(dataset)
setTenantValue(value)
setUserUID(a_userUID, newUserUID)