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
  • Classes
  • Functions
  • Permission
  • Role
  • Session
  • Tenant
  • User
  • changeExternalDBTransactionSupportFlag(mustSupportExternalTransactions)
  • cloneTenant(tenantToClone, name, [makeSlave]) ⇒ Tenant
  • consumeAccessToken(token) ⇒ User
  • createTenant(name) ⇒ Tenant
  • deleteTenant(tenant) ⇒ Boolean
  • getActiveSessions() ⇒ [ 'Array' ].<Session>
  • getPermission(name) ⇒ Permission
  • getPermissions() ⇒ [ 'Array' ].<Permission>
  • getRole(roleName, [tenantName]) ⇒ Role
  • getSession() ⇒ Session
  • getSessionCount() ⇒ Number
  • getTenant([name]) ⇒ Tenant
  • getTenants() ⇒ [ 'Array' ].<Tenant>
  • getUser([userName], [tenantName]) ⇒ User
  • getUsers() ⇒ [ 'Array' ].<User>
  • getVersion() ⇒ String
  • login(user, [userUid], [permissionsToApply]) ⇒ Boolean
  • logout()
  • syncPermissions([forcePermissionRemoval])

Was this helpful?

  1. Reference
  2. Extensions
  3. Modules
  4. svySecurity

API Documentation

PreviousToken-based Auth and SSO (NEW!)NextGetting Started

Last updated 1 year ago

Was this helpful?

Classes

Represents a security permission in the system. Mapped internally to a Servoy security group which must be defined.

Security role which can have members and can be granted .

Security application session created by a which starts when the user and ends when the user .

Tenant account which is used to segregate all data. and belong to a Tenant.

Application user account associated with a . Security are granted to users through their membership.

Functions

Use this method to change the behavior of the svySecurity module with respect to DB transactions.

If the flag is set to false (default) then when saving or deleting security-related records if an external DB transaction is detected the operation will fail. If the flag is set to true then when saving or deleting security-related records the module will start/commit a DB transaction only if an external DB transaction is not detected. On exceptions any DB transaction will be rolled back regardless if it is started internally or externally (exceptions will be propagated to the external transaction so callers will be able to react on them accordingly)

⇒

Creates and returns a new tenant with the specified name as a clone of the given tenant. The names of tenants must be unique in the system. The cloned tenant has the same roles and role permissions as the original. When makeSlave is true, the newly created clone will be a slave of the tenant to clone, inheriting all role / permission changes made to the master. WARNING: Cannot call this function when logged in as an user.

Creates and returns a new tenant with the specified name. The names of tenants must be unique in the system.

Immediately and permanently deletes the specified tenant and all records associated with it, including all users and roles. Tenant will not be deleted if it has users with active sessions. If the deleted tenant is a Master tenant and is a slave of another master tenant, this operation will replace the master tenant of it's direct slaves with the master of the tenant that is deleted; If the delated tenant is a Master tenant and has no Master tenant, this operation will remove the master from all it's direct slaves.

Gets all active sessions for the application.

Gets a permission by its unique permission name.

Gets all permissions available in this application.

Gets a role by the specified role name and tenant name. If tenant name is not specified will use the tenant of the user currently logged in the application, if available.

Gets the number of all unique sessions which have ever been initialized in the application. This includes both active sessions (for users currently logged in the application) and inactive sessions (sessions from the past which have already been closed).

Gets a tenant by its unique tenant name. If tenant name is not specified then will return the tenant of the currently logged in user. If tenant name is not specified and no user is currently logged in then will return null.

Gets all tenants in the system.

Gets a user by the specified username and tenant name. If username is not specified will return the user currently logged in the application, if available.

Gets all users in the system.

Gets the version of this module

Utility to sync permission records to the internal, design-time Servoy Security Groups. This should be called on solution import or on startup This action will create new permission records.

NOTE: This action will not delete permissions which have been removed from internal security. Design-time groups should never be renamed. They will be seen only as an ADD and will lose their tie to roles.

Permission

Represents a security permission in the system. Mapped internally to a Servoy security group which must be defined.


Grants this permission to the specified role. The permission will be granted to all users that are members of the specified role. If the tenant of this permission is a master tenant, the role will also be added to the same permission for all the slaves of this permission tenant. You cannot grant permission to role of a master tenant when logged in as an user. You cannot grant permission to role of a slave tenant at anytime.

Param
Type
Description

role

The role object to which the permission should be granted.

permission.getDisplayName() ⇒ String

Returns: String - The display name of the permission. Can be null.

permission.getName() ⇒ String

Gets the name of this permission. The permission name is unique in the system and matches a Servoy security group name.

Returns: String - The name of the permission.

Gets all the roles to which this permission is granted.

Gets all users whom this permission is granted to via the users' role membership.

permission.hasRole(role) ⇒ Boolean

Checks if this permission is granted to the specified role.

Returns: Boolean - True if this permission is granted to the specified role.

Param
Type
Description

role

The role object or the name of the role to check.

Removes this permission from the specified role. The permission will no longer be granted to all users that are members of the specified role. If the tenant of this permission is a master tenant, the role will also be removed from the same permission for all the slaves of this permission tenant. You cannot remove permission from role of a master tenant when logged in as an user. You cannot remove permission from role of a slave tenant at anytime.

Param
Type
Description

role

The role object or the name of the role to remove.

Sets the display name of this permission.

Param
Type
Description

[displayName]

String

The display name to use.

new Permission(record)

Param
Type

record

[ 'JSRecord' ].<permissions>


Role

Grants the specified permission to this role. Any users that are members of this role will be granted the permission. If the tenant of this role is a master tenant, the permission will also be added to the same role in all slaves of this role tenant. You cannot grant permission to role of a master tenant when logged in as an user. You cannot grant permission to role of a slave tenant at anytime.

Param
Type
Description

permission

The permission object or name of permission to add.\ Throws an exception when permission cannot be grant.

Adds the specified user as member of this role. All permissions granted to this role will be granted to the user.

Param
Type
Description

user

The user object or username of user to add. The user must be associated with the tenant of this role.

role.getDisplayName() ⇒ String

Gets the display name of this role.

Returns: String - The display name of this role. Can be null.

role.getName() ⇒ String

Gets the name of this role. The role name is unique to the associated tenant.

Returns: String - The role name.

Gets all the permissions granted to this role.

Gets the tenant which this role belongs to.

Gets all the users who are members of this role.

role.hasPermission(permission) ⇒ Boolean

Checks if the specified permission is granted to this role.

Returns: Boolean - True if the specified permission is granted to this role.

Param
Type
Description

permission

The permission object or name of permission to check.

role.hasUser(user) ⇒ Boolean

Checks if the specified user is a member of this role.

Returns: Boolean - True if the specified user is a member of this role.

Param
Type
Description

user

The user object or username of user to check. The user must be associated with the tenant of this role.

Removes the specified permission from this role. The permission will no longer be granted to all users that are members of this role. If the tenant of this role is a master tenant, the permission will also be removed from the same role in all slaves of this role tenant. You cannot remove permission from role of a master tenant when logged in as an user. You cannot remove permission from role of a slave tenant at anytime.

Param
Type
Description

permission

The permission object or name of permission to remove.

Removes the specified user from the members of this role. All permissions granted to this role will no longer be granted to the user.

Param
Type
Description

user

The user object or username of user to remove.

Sets the display name of this role. If the tenant of this role is a master tenant, the displayName will be set to the same role in all slaves of this role tenant. You cannot set the display name to role of a master tenant when logged in as an user. You cannot set the display name to role of a slave tenant at anytime.

Param
Type
Description

displayName

String

The display name to use.

new Role(record)

Param
Type

record

[ 'JSRecord' ].<roles>


Session

session.getDuration() ⇒ Number

Gets the session duration in milliseconds (as updated in the database)

Returns: Number - The Servoy Client ID associated with the session.

Note: The session duration is updated on each "client ping" which by default is once per minute

session.getEnd() ⇒ Date

Returns: Date - The end date/time of this session.

session.getID() ⇒ String

Gets the internal unique ID of this session. This matches the Servoy Client ID as seen in the Servoy App Server admin page.

Returns: String - The internal unique ID of this session.

session.getIPAddress() ⇒ String

Gets the client IP address of the session.

Returns: String - The client IP address of the session.

session.getServoyClientID() ⇒ String

Gets the Servoy Client ID associated with the session (as shown on the Servoy app server admin page).

Returns: String - The Servoy Client ID associated with the session.

Note: Multiple user sessions can have the same Servoy Client ID if the client is not closed between different logins (for NG/Web clients this requires complete closing of the browser and not just a tab).

session.getSolutionName() ⇒ String

Gets the name of the Servoy solution that was accessed by this session

session.getStart() ⇒ Date

Returns: Date - The start date/time of this session.

session.getTenantName() ⇒ String

Gets the name of the tenant associated with this session. It will be available even if the associated tenant account is deleted.

Returns: String - The name of the tenant associated with this session.

session.getUserAgentString() ⇒ String

Gets the client user agent string of the session. The user agent string will be null if the session was not browser-based.

Returns: String - The client user agent string of this session. Can be null.

session.getUserName() ⇒ String

The username of the user associated with this session. It will be available even if the associated user account is deleted.

Returns: String - The username of the user who created this session.

session.isAbandoned() ⇒ Boolean

Returns: Boolean - True if this session was not terminated/closed normally, but has timed out due to inactivity.

session.isActive() ⇒ Boolean

Indicates if this session is still active.

Returns: Boolean - True if the session has not been terminated and has not been inactive for longer than the session inactivity timeout period.

session.isTerminated() ⇒ Boolean

Returns: Boolean - True if the session was terminated/closed normally or by timeout from inactivity.

new Session(record)

Param
Type

record

[ 'JSRecord' ].<sessions>


Tenant

Creates a role associated with this tenant using the specified role name. If this is a Master Tenant the created role will be added to all slaves of this Tenant. Cannot create role for a master tenant when logged in as an user.

Param
Type
Description

name

String

The name of the role to be created. Must be unique to this tenant.

Creates a slave of this tenant with the given name. Modifications to roles and permissions of this tenant will be propagated to all of its slaves.

WARNING: Cannot call this function when logged in as an user.

Param
Type
Description

name

String

The name of the tenant. Must be unique and no longer than 50 characters. Throws an exception if this function is called when logged in as an user.

Creates a user with the specified user name.

Param
Type
Description

userName

String

Must be unique in system.

[password]

String

The password to use for the new user.

Deletes the specified role from this tenant. All associated permissions and grants to users are removed immediately. Users with active sessions will be affected, but design-time security (CRUD, UI) will not be affected until next log-in.

If this is a Master Tenant the deleted role will be deleted also for all slaves of this Tenant. Cannot delete role of a master tenant when logged in as an user.

Param
Type
Description

role

The role object or name of role to be deleted. The role must be associated with this tenant. throws an exception if the role cannot be deleted.

tenant.deleteUser(user) ⇒ Boolean

Immediately and permanently deletes the specified user and all security-related records associated with it. The user will not be deleted if it has active sessions.

Returns: Boolean - True if the user is deleted, otherwise false.

Note: USE WITH CAUTION! There is no undo for this operation.

Param
Type
Description

user

The user object or the username of the user to be deleted. The specified user must be associated with this tenant.

Gets the active sessions for users associated with this tenant. This includes any sessions from any device and any location for users associated with this tenant.

Note: Any unterminated sessions are deemed to be active when they have not been idle for more than a set timeout period.

tenant.getDisplayName() ⇒ String

Returns: String - The display name of this tenant. Can be null if a display name is not set.

tenant.getLockExpiration() ⇒ Date

Returns: Date - The date/time when the lock expires. Can be null. The date/time is using the Servoy application server timezone.

tenant.getLockReason() ⇒ String

Returns: String - The lock reason. Can be null.

tenant.getName() ⇒ String

Gets the name of this tenant. Tenant names are unique in the system and are specified when the tenant is created.

Returns: String - The name of this tenant.

Gets a role by name unique to this tenant.

Param
Type
Description

name

String

The name of the role to get.

Gets the roles associated with this tenant.

tenant.getSessionCount() ⇒ Number

Gets the number of all unique sessions which have ever been initialized in the system by users associated with this tenant. This includes both active sessions (for users currently logged in the application) and inactive sessions (sessions from the past which have already been terminated).

Returns: Number - The number of all sessions (active and inactive) for users associated with this tenant.

Gets all slaves of this tenant When recursive is true, all slaves of this tenant's slaves are included WARNING: Cannot call this function when logged in as an user.

Throws an exception if this function is called when logged in as an user.

Gets the user (associated with this tenant) specified by the username.

Param
Type
Description

userName

String

The username of the user.

Gets all users for this tenant.

tenant.isLocked() ⇒ Boolean

Returns: Boolean - True if the tenant account is currently locked and the lock has not expired.

tenant.isMasterTenant() ⇒ Boolean

Returns true if this Tenant is a master (template) tenant WARNING: When the user is already logged, can call this function only for the tenant of the logged user; cannot call this function for other tenants when logged in as an user.

Returns: Boolean - isMasterTenant Whether this tenant is a master to other tenants

Throws an exception when logged in as an user and called for another tenant than the tenant of the logged user.

tenant.isSlaveTenant() ⇒ Boolean

Returns true if this Tenant is a slave tenant

Returns: Boolean - isMasterTenant Whether this tenant is a master to other tenants

Locks the tenant account preventing its users from logging in. The lock will remain in place until it expires (if a duration was specified) or it is removed using {Tenant#unlock}. Users with active sessions will be unaffected until subsequent login attempts. Can be called even if the tenant is already locked. In such cases the lock reason and duration will be reset.

Param
Type
Description

[reason]

String

The reason for the lock.

[duration]

Number

The duration of the lock (in milliseconds). If no duration specified, the lock will remain until {Tenant#unlock} is called.

Sets the display name of this tenant.

Param
Type
Description

displayName

String

The display name to use.

new Tenant(record)

Param
Type
Description

record

[ 'JSRecord' ].<tenants>

The database record where the tenant account information is stored.


User

Adds this user as member of the specified role and grants the user all permissions which the role has.

Param
Type
Description

role

The role object or role name to use. The role must be associated with the tenant of this user.

user.checkPassword(password) ⇒ Boolean

Returns: Boolean - True if the specified password matches the password of this user.

Param
Type
Description

password

String

The password (plain-text) to check.

user.generateAccessToken([duration]) ⇒ String

Returns: String - The generated access token.

Param
Type
Description

[duration]

Number

The duration of token validity in milliseconds. Default is 30 minutes in future.

Gets the active sessions this user. This includes any sessions from any device and any location for this user.

Note: Any unterminated sessions are deemed to be active when they have not been idle for more than a set timeout period.

user.getDisplayName() ⇒ String

Returns: String - The display name of this user.

user.getEmail() ⇒ String

Returns: String - The email of this user.

user.getLockExpiration() ⇒ Date

Returns: Date - The date/time when the lock expires. Can be null. The date/time is using the Servoy application server timezone.

user.getLockReason() ⇒ String

Returns: String - The lock reason. Can be null.

Gets all the roles that this user is member of.

user.getSessionCount() ⇒ Number

Gets the number of all unique sessions which have ever been initialized in the system by this user. This includes both active sessions (for users currently logged in the application) and inactive sessions (sessions from the past which have already been terminated).

Returns: Number - The number of all sessions (active and inactive) for this user.

Returns the tenant that owns this user account.

user.getUserName() ⇒ String

Gets the username of this user which was specified when the user was created. The username cannot be changed after the user is created and is unique to the associated tenant.

Returns: String - The username of this user.

user.hasPermission(permission) ⇒ Boolean

Returns: Boolean - True if the user has been granted the specified permission.

Param
Type
Description

permission

The permission object or permission name to check.

user.hasRole(role) ⇒ Boolean

Checks if this user is a member of the specified role.

Returns: Boolean - True if the user is a member of the specified role.

Param
Type
Description

role

The role object or role name to check. The role must be associated with the tenant of this user.

user.isLocked() ⇒ Boolean

Returns: Boolean - True if the user account is currently locked and the lock has not expired.

Locks the user account preventing it from logging in. The lock will remain in place until it expires (if a duration was specified) or it is removed using {User#unlock}. Users with active sessions will be unaffected until subsequent login attempts. Can be called even if the user account is already locked. In such cases the lock reason and duration will be reset.

Param
Type
Description

[reason]

String

The reason for the lock.

[duration]

Number

The duration of the lock (in milliseconds). If no duration specified, the lock will remain until {User#unlock} is called.

Removes the membership of this user from the specified role. All permissions of the role will no longer be granted to the user.

Param
Type
Description

role

The role object or role name to use. The role must be associated with the tenant of this user.

Sets the display name of this user.

Param
Type
Description

displayName

String

The display name to use.

Param
Type

email

String

Sets the users password. The specified plain-text password will not be stored. Only its hash will be stored and used for password validation. The actual plain-text password cannot be retrieved from the stored hash.

Param
Type
Description

password

String

The plain-text password to use.

new User(record)

Param
Type

record

[ 'JSRecord' ].<users>


changeExternalDBTransactionSupportFlag(mustSupportExternalTransactions)

Use this method to change the behavior of the svySecurity module with respect to DB transactions.

If the flag is set to false (default) then when saving or deleting security-related records if an external DB transaction is detected the operation will fail. If the flag is set to true then when saving or deleting security-related records the module will start/commit a DB transaction only if an external DB transaction is not detected. On exceptions any DB transaction will be rolled back regardless if it is started internally or externally (exceptions will be propagated to the external transaction so callers will be able to react on them accordingly)

Note: If using external DB transactions then callers are responsible for refreshing the state of security-related objects upon transaction rollbacks which occur after successful calls to the svySecurity API.

Param
Type
Description

mustSupportExternalTransactions

Boolean

The value for the supportExternalDBTransaction flag to set.


Creates and returns a new tenant with the specified name as a clone of the given tenant. The names of tenants must be unique in the system. The cloned tenant has the same roles and role permissions as the original. When makeSlave is true, the newly created clone will be a slave of the tenant to clone, inheriting all role / permission changes made to the master. WARNING: Cannot call this function when logged in as an user.

Param
Type
Description

tenantToClone

The tenant to clone from

name

String

The name of the tenant. Must be unique and no longer than 50 characters.

[makeSlave]

Boolean

When true, the cloned tenant will be a slave of the tenant to clone (defaults to false).


Note: An error will be thrown if this method is called from within an active user session.

Param
Type
Description

token

String

The secure-access token to use.


Creates and returns a new tenant with the specified name. The names of tenants must be unique in the system.

Param
Type
Description

name

String

The name of the tenant. Must be unique and no longer than 50 characters.


deleteTenant(tenant) ⇒ Boolean

Immediately and permanently deletes the specified tenant and all records associated with it, including all users and roles. Tenant will not be deleted if it has users with active sessions. If the deleted tenant is a Master tenant and is a slave of another master tenant, this operation will replace the master tenant of it's direct slaves with the master of the tenant that is deleted; If the delated tenant is a Master tenant and has no Master tenant, this operation will remove the master from all it's direct slaves.

Returns: Boolean - False if tenant could not be deleted, most commonly because of active user sessions associated with the tenant.

Note: USE WITH CAUTION! There is no undo for this operation.

Param
Type
Description

tenant

The tenant object or the name of the tenant to delete.


Gets all active sessions for the application.


Gets a permission by its unique permission name.

Param
Type
Description

name

String

The name of the permission.


Gets all permissions available in this application.


Gets a role by the specified role name and tenant name. If tenant name is not specified will use the tenant of the user currently logged in the application, if available.

Note: Will fail if tenant is not specified and user is not logged in and multiple roles are found with the specified role name but associated with different tenants.

Param
Type
Description

roleName

String

The name of the role to get.

[tenantName]

String

If not specified will use the tenant of the current logged in user (if user is not currently logged in


Note: Sessions represent authenticated user sessions. They are not initialized until after user login.


getSessionCount() ⇒ Number

Gets the number of all unique sessions which have ever been initialized in the application. This includes both active sessions (for users currently logged in the application) and inactive sessions (sessions from the past which have already been closed).

Returns: Number - The number of all sessions (active and closed).


Gets a tenant by its unique tenant name. If tenant name is not specified then will return the tenant of the currently logged in user. If tenant name is not specified and no user is currently logged in then will return null.

Param
Type
Description

[name]

String

The name of the tenant to get. Or null to get the current tenant.

Example

//get the tenant of the current user
var currentUserTenant = scopes.svySecurity.getTenant();
//get a specific tenant
var tenant = scopes.svySecurity.getTenant('tenantNameToGet');

Gets all tenants in the system.


Gets a user by the specified username and tenant name. If username is not specified will return the user currently logged in the application, if available.

Note: Will fail if tenant is not specified and user is not logged in and multiple users are found with the specified username but associated with different tenants.

Param
Type
Description

[userName]

String

The username of the user to return. Can be null to get the current user.

[tenantName]

String

The name of the tenant associated with the user. Can be null if username is also null when getting the current user.


Gets all users in the system.


getVersion() ⇒ String

Gets the version of this module

Returns: String - the version of the module using the format Major.Minor.Revision


login(user, [userUid], [permissionsToApply]) ⇒ Boolean

Param
Type
Description

user

The user to log in.

[userUid]

String | UUID

The uid to log the user in with (defaults to userName)

[permissionsToApply]

[ 'Array' ].<(String|Permission)>

Optional permissions to assign to the user. Note that these permissions cannot be asked for using User.getPermissions() or User.hasPermission().


logout()


syncPermissions([forcePermissionRemoval])

Utility to sync permission records to the internal, design-time Servoy Security Groups. This should be called on solution import or on startup This action will create new permission records.

NOTE: This action will not delete permissions which have been removed from internal security. Design-time groups should never be renamed. They will be seen only as an ADD and will lose their tie to roles.

Param
Type
Description

[forcePermissionRemoval]

Boolean

if true then permissions without a matching Servoy security group will be deleted regardless if they have been granted to any role or not; if false (default) then permissions without a matching Servoy security group will be deleted only if they have not been granted to any role


⇒

Consumes a secure-access token and returns the user associated with the token if a valid match was found. Tokens may be used only once to identify a user. Subsequent calls to consume the same token will fail. Secure-access tokens are created with

⇒

⇒ Boolean

⇒

⇒

⇒

⇒

⇒

Gets the current user session or null if no session initialized (no user is currently ).

⇒ Number

⇒

⇒

⇒

⇒

⇒ String

⇒ Boolean

Logs in the specified user and initializes a new for it. The login request will not be successful if the user account or the parent account and the lock has not yet. The login request will not be successful also if no have been granted to the specified user. This method internally calls the standard Servoy security.login().

Logs the current user out of the application and closes the associated . This method internally calls security.logout() to end the Servoy client session.

⇒

⇒ String

⇒ String

⇒

⇒

⇒ Boolean

⇒

⇒

permission.addRole(role) ⇒

Returns: - This permission for call-chaining support. Throws an exception when permission cannot be granted.

Gets the display name of this permission. The display name can be set using .

permission.getRoles() ⇒

Returns: - An array with all roles to which this permission is granted or an empty array if the permission has not been granted to any role.

permission.getUsers() ⇒

Returns: - An array with all users whom this permission is granted to or an empty array if no user has this permission.

| String

permission.removeRole(role) ⇒

Returns: - This permission for call-chaining support. Throws an exception when permission cannot be removed.

| String

permission.setDisplayName([displayName]) ⇒

Returns: - This permission for call-chaining support.

Permission objects cannot be created through the API. They are created automatically when the scope is loaded. Use or to get permission objects. Creating permission objects with the new operator is reserved for internal use only.

Security role which can have members and can be granted .

⇒

⇒

⇒ String

⇒ String

⇒

⇒

⇒

⇒ Boolean

⇒ Boolean

⇒

⇒

⇒

role.addPermission(permission) ⇒

Returns: - This role for call-chaining support.

| String

role.addUser(user) ⇒

Returns: - This role for call-chaining support.

| String

role.getPermissions() ⇒

Returns: - An array with all permissions granted to this role or an empty array if no permissions are granted.

role.getTenant() ⇒

Returns: - The tenant which this role belongs to.

role.getUsers() ⇒

Returns: - An array with all users who are members of this role or an empty array if the role has no members.

| String

| String

role.removePermission(permission) ⇒

Returns: - This role for call-chaining support. Throws an exception when permission cannot be removed.

| String

role.removeUser(user) ⇒

Returns: - This role for call-chaining support.

| String

role.setDisplayName(displayName) ⇒

Returns: - This role for call-chaining support. throws an exception if the displayName cannot be changed

Use to create role objects. Creating role objects with the new operator is reserved for internal use only.

Security application session created by a which starts when the user and ends when the user .

⇒ Number

⇒ Date

⇒ String

⇒ String

⇒ String

⇒ String

⇒ Date

⇒

⇒ String

⇒

⇒ String

⇒ String

⇒ Boolean

⇒ Boolean

⇒ Boolean

Gets the end datetime of this session. Can be null if the session is still active or if the session has not been properly closed. The session end date/time is set by .

Gets the start date/time of this session. The session start date/time is set by .

session.getTenant() ⇒

Gets the tenant associated with this session. Returns null if the tenant has been deleted. In such cases use as it will be preserved even if the tenant account is deleted.

session.getUser() ⇒

Gets the user who created this session. Returns null if the user account has been deleted. In such cases use as it will be preserved even if the user account is deleted.

Returns: - The user who created this session or null if the user account has been deleted.

Indicates if this session was abandoned and closed due to inactivity and was not closed by .

Indicates if this session was terminated/closed using or closed due to inactivity.

Session objects cannot be created through the API. They are created automatically when a user is logged in. Use to get the current session or to get all active sessions. Creating session objects with the new operator is reserved for internal use only.

Tenant account which is used to segregate all data. and belong to a Tenant.

⇒

⇒

⇒

⇒

⇒ Boolean

⇒

⇒ String

⇒ Date

⇒ String

⇒ String

⇒

⇒

⇒ Number

⇒

⇒

⇒

⇒ Boolean

⇒ Boolean

⇒ Boolean

⇒

⇒

⇒

tenant.createRole(name) ⇒

Returns: - The role which was created. If the role name is not unique to this tenant.

tenant.createSlave(name) ⇒

Returns: - slave The slave that has been created

tenant.createUser(userName, [password]) ⇒

Returns: - The user which was created. If the user name is not specified or is not unique.

Note: If password is not specified the user account will be created with a blank password. Use to set or change the user password.

tenant.deleteRole(role) ⇒

Returns: - This tenant for call-chaining support.

| String

| String

tenant.getActiveSessions() ⇒

Returns: - An array with all active sessions for users associated with this tenant or an empty array if the are no active sessions.

Gets the display name of this tenant. The display name can be set using .

Gets the expiration date/time of the lock created by . The lock will remain in place until it expires or it is removed using .

Gets the reason for the account lock created by .

tenant.getRole(name) ⇒

Returns: - The matching role, or null if a role with the specified name and associated with this tenant is not found.

tenant.getRoles() ⇒

Returns: - An array with the roles associated with this tenant or an empty array if the tenant has no roles.

tenant.getSlaves() ⇒

Returns: - slaves Array of tenants that have this tenant as their master

tenant.getUser(userName) ⇒

Returns: - The matching user or null if a user with the specified username and associated with this tenant is not found.

tenant.getUsers() ⇒

Returns: - An array with all users associated with this tenant or an empty array if the tenant has no users.

Indicates if the tenant account is locked using .

tenant.lock([reason], [duration]) ⇒

Returns: - This tenant for call-chaining support.

tenant.setDisplayName(displayName) ⇒

Returns: - This tenant for call-chaining support.

tenant.unlock() ⇒

Removes the lock on the tenant account which is created by . Can be safely called even if the tenant is not locked.

Returns: - This tenant for call-chaining support.

Use to create tenant objects. Creating tenant objects with the new operator is reserved for internal use only.

Application user account associated with a . Security are granted to users through their membership.

⇒

⇒ Boolean

⇒ String

⇒

⇒ String

⇒ String

⇒ Date

⇒ String

⇒

⇒

⇒ Number

⇒

⇒ String

⇒ Boolean

⇒ Boolean

⇒ Boolean

⇒

⇒

⇒

⇒

⇒

⇒

user.addRole(role) ⇒

Returns: - This user for call-chaining support.

| String

Checks if the specified password matches the password of this user. User password can be set when the user is created or by using .

Generates a secure access token to authenticate this user within a window of validity of the specified duration. The generated access token can be used with .

user.getActiveSessions() ⇒

Returns: - An array with all active sessions for this user or an empty array if the are no active sessions.

Gets the display name of this user, i.e. "Jane Doe". The display name can be set using .

Gets the expiration date/time of the lock created by . The lock will remain in place until it expires or it is removed using .

Gets the reason for the account lock created by .

user.getPermissions() ⇒

Gets all the permissions granted to this user via its roles membership. Result will exclude duplicates. Permissions cannot be granted directly to the user. Use or to make the user a member of specific roles and all role permissions will be granted to the user.

Returns: - An array with the permissions granted to this user or an empty array if the user has no permissions.

user.getRoles() ⇒

Returns: - An array with all roles which this user is member of or an empty array if the user is not a member of any role.

user.getTenant() ⇒

Returns: - The parent tenant associated with this user.

Checks if the this user is granted the specified permission via the user's role membership. Permissions cannot be granted directly to the user. Use or to make the user a member of specific roles and all role permissions will be granted to the user.

| String

| String

Indicates if the use account is locked using .

user.lock([reason], [duration]) ⇒

Returns: - This user for call-chaining support.

user.removeRole(role) ⇒

Returns: - This user for call-chaining support.

| String

user.setDisplayName(displayName) ⇒

Returns: - This user for call-chaining support.

user.setEmail(email) ⇒

Returns: - This user for call-chaining support.

user.setPassword(password) ⇒

Returns: - This user for call-chaining support.

user.unlock() ⇒

Removes the lock on the user account which is created by . Can be safely called even if the user account is not locked.

Returns: - This user for call-chaining support.

cloneTenant(tenantToClone, name, [makeSlave]) ⇒

Returns: - The cloned tenant that is created. Throws an exception if this function is called when logged in as an user.

consumeAccessToken(token) ⇒

Consumes a secure-access token and returns the user associated with the token if a valid match was found. Tokens may be used only once to identify a user. Subsequent calls to consume the same token will fail. Secure-access tokens are created with

Returns: - The user associated with the specified token or null if the token is not valid or has expired.

createTenant(name) ⇒

Returns: - The tenant that is created.

| String

getActiveSessions() ⇒

Returns: - An array will all active sessions or an empty array if there are no active sessions.

Note: If users close the application without then their sessions will remain active for a period of time.

getPermission(name) ⇒

Returns: - The specified permission or null if a permission with the specified name is not found.

getPermissions() ⇒

Returns: - An array with all permissions or an empty array if no permissions are defined.

getRole(roleName, [tenantName]) ⇒

Returns: - The specified role or null if not found.

getSession() ⇒

Gets the current user session or null if no session initialized (no user is currently ).

Returns: - The current session or null if a user is not currently logged in.

getTenant([name]) ⇒

Returns: - The tenant or null if not found / no user is logged in.

getTenants() ⇒

Returns: - An array with all tenants or an empty array if no tenants are defined.

getUser([userName], [tenantName]) ⇒

Returns: - The specified user (or current user if parameters are not specified) or null if the specified user does not exist (or if parameters are not specified and a user is not logged in currently).

getUsers() ⇒

Returns: - An array with all users or an empty array if no users are defined.

Logs in the specified user and initializes a new for it. The login request will not be successful if the user account or the parent account and the lock has not yet. The login request will not be successful also if no have been granted to the specified user. This method internally calls the standard Servoy security.login().

Returns: Boolean - Returns true if the login was successful and a user was created, otherwise false.

Note: This method does not perform any password checks - for validation of user passwords use .

Logs the current user out of the application and closes the associated . This method internally calls security.logout() to end the Servoy client session.

Permission
Role
user
permissions
Session
User
logs in
logs out
Tenant
Users
Roles
User
Tenant
Permissions
Role
changeExternalDBTransactionSupportFlag(mustSupportExternalTransactions)
cloneTenant(tenantToClone, name, [makeSlave])
Tenant
consumeAccessToken(token)
User
generateAccessToken
createTenant(name)
Tenant
deleteTenant(tenant)
getActiveSessions()
[ 'Array' ].<Session>
getPermission(name)
Permission
getPermissions()
[ 'Array' ].<Permission>
getRole(roleName, [tenantName])
Role
getSession()
Session
logged in
getSessionCount()
getTenant([name])
Tenant
getTenants()
[ 'Array' ].<Tenant>
getUser([userName], [tenantName])
User
getUsers()
[ 'Array' ].<User>
getVersion()
login(user, [userUid], [permissionsToApply])
Session
tenant
is locked
expired
permissions
logout()
Session
syncPermissions([forcePermissionRemoval])
Permission
.addRole(role)
Permission
.getDisplayName()
.getName()
.getRoles()
[ 'Array' ].<Role>
.getUsers()
[ 'Array' ].<User>
.hasRole(role)
.removeRole(role)
Permission
.setDisplayName([displayName])
Permission
new Permission(record)
Permission
Permission
setDisplayName
[ 'Array' ].<Role>
[ 'Array' ].<Role>
[ 'Array' ].<User>
[ 'Array' ].<User>
Permission
Permission
Permission
Permission
getPermission
getPermissions
user
permissions
Role
.addPermission(permission)
Role
.addUser(user)
Role
.getDisplayName()
.getName()
.getPermissions()
[ 'Array' ].<Permission>
.getTenant()
Tenant
.getUsers()
[ 'Array' ].<User>
.hasPermission(permission)
.hasUser(user)
.removePermission(permission)
Role
.removeUser(user)
Role
.setDisplayName(displayName)
Role
new Role(record)
Role
Role
Role
Role
[ 'Array' ].<Permission>
[ 'Array' ].<Permission>
Tenant
Tenant
[ 'Array' ].<User>
[ 'Array' ].<User>
Role
Role
Role
Role
Role
Role
createRole
User
logs in
logs out
Session
.getDuration()
.getEnd()
.getID()
.getIPAddress()
.getServoyClientID()
.getSolutionName()
.getStart()
.getTenant()
Tenant
.getTenantName()
.getUser()
User
.getUserAgentString()
.getUserName()
.isAbandoned()
.isActive()
.isTerminated()
new Session(record)
logout
login
Tenant
getTenantName
User
getUserName
User
logout
logout
getSession
getActiveSessions
Users
Roles
Tenant
.createRole(name)
Role
.createSlave(name)
Tenant
.createUser(userName, [password])
User
.deleteRole(role)
Tenant
.deleteUser(user)
.getActiveSessions()
[ 'Array' ].<Session>
.getDisplayName()
.getLockExpiration()
.getLockReason()
.getName()
.getRole(name)
Role
.getRoles()
[ 'Array' ].<Role>
.getSessionCount()
.getSlaves()
[ 'Array' ].<Tenant>
.getUser(userName)
User
.getUsers()
[ 'Array' ].<User>
.isLocked()
.isMasterTenant()
.isSlaveTenant()
.lock([reason], [duration])
Tenant
.setDisplayName(displayName)
Tenant
.unlock()
Tenant
new Tenant(record)
Role
Role
Tenant
Tenant
User
User
setPassword
Tenant
Tenant
[ 'Array' ].<Session>
[ 'Array' ].<Session>
setDisplayName
lock
unlock
lock
Role
Role
[ 'Array' ].<Role>
[ 'Array' ].<Role>
[ 'Array' ].<Tenant>
[ 'Array' ].<Tenant>
User
User
[ 'Array' ].<User>
[ 'Array' ].<User>
lock
Tenant
Tenant
Tenant
Tenant
Tenant
lock
Tenant
createTenant
Tenant
Permissions
Role
User
.addRole(role)
User
.checkPassword(password)
.generateAccessToken([duration])
.getActiveSessions()
[ 'Array' ].<Session>
.getDisplayName()
.getEmail()
.getLockExpiration()
.getLockReason()
.getPermissions()
[ 'Array' ].<Permission>
.getRoles()
[ 'Array' ].<Role>
.getSessionCount()
.getTenant()
Tenant
.getUserName()
.hasPermission(permission)
.hasRole(role)
.isLocked()
.lock([reason], [duration])
User
.removeRole(role)
User
.setDisplayName(displayName)
User
.setEmail(email)
User
.setPassword(password)
User
.unlock()
User
new User(record)
User
User
setPassword
consumeAccessToken
[ 'Array' ].<Session>
[ 'Array' ].<Session>
setDisplayName
lock
unlock
lock
[ 'Array' ].<Permission>
addRole
addUser
[ 'Array' ].<Permission>
[ 'Array' ].<Role>
[ 'Array' ].<Role>
Tenant
Tenant
addRole
addUser
lock
User
User
User
User
User
User
User
User
User
User
User
lock
User
Tenant
Tenant
User
generateAccessToken
User
Tenant
Tenant
[ 'Array' ].<Session>
[ 'Array' ].<Session>
logging out
Permission
Permission
[ 'Array' ].<Permission>
[ 'Array' ].<Permission>
Role
Role
Session
logged in
Session
Tenant
Tenant
[ 'Array' ].<Tenant>
[ 'Array' ].<Tenant>
User
User
[ 'Array' ].<User>
[ 'Array' ].<User>
Session
tenant
is locked
expired
permissions
Session
User.checkPassword
Session
Role
Role
Role
Permission
User
Permission
User
Permission
User
Role
User
Role
Permission
Role
Role
Tenant
Tenant
User