Skip to main content


persistent class Security.SQLRoleGrantOption extends %Library.Persistent, %XML.Adaptor, %SYSTEM.Help

SQL Table Name: Security.SQLRoleGrantOption

Define the SQL RoleGrantOption mapping in the ^SYS global for whether a role is granted to the user/role with admin/grant option Mapping was added for SQL RoleGrantOption to take advantage of XML export

Property Inventory

Method Inventory


property Grantable as %TinyInt (VALUELIST = ",0,1") [ Required ];
Grantable - 1/0, can this role be granted by the user
Property methods: GrantableDisplayToLogical(), GrantableGet(), GrantableIsValid(), GrantableLogicalToDisplay(), GrantableNormalize(), GrantableSet(), GrantableXSDToLogical()
property RoleGranted as %String (MAXLEN = 64, MINLEN = 1) [ Required ];
RoleGranted - Role that was granted to the user/role
Property methods: RoleGrantedDisplayToLogical(), RoleGrantedGet(), RoleGrantedIsValid(), RoleGrantedLogicalToDisplay(), RoleGrantedLogicalToOdbc(), RoleGrantedNormalize(), RoleGrantedSet()
property UserOrRole as %String (MAXLEN = 64, MINLEN = 1) [ Required ];
UserOrRole - User or Role the role was granted to
Property methods: UserOrRoleDisplayToLogical(), UserOrRoleGet(), UserOrRoleIsValid(), UserOrRoleLogicalToDisplay(), UserOrRoleLogicalToOdbc(), UserOrRoleNormalize(), UserOrRoleSet()


classmethod Export(FileName As %String = "SQLRoleGrantOptionExport.xml", ByRef NumExported As %Integer = 0) as %Status
This method exports SQLRoleGrantOption records to a file in xml format.
Filename - Output file name
NumExported (byref) - Returns number of records exported.
classmethod Import(FileName As %String, ByRef NumImported As %Integer, Flags As %Integer = 0) as %Status
Import SQLRoleGrantOption records from an xml file.
FileName - Filename to import Role records from
NumImported (byref) - Returns number of records imported
Flags - Control import
Bit 0 - Do not import records, just return count
Note: On failure, no records will be imported


query DirectRoles(UserOrRole As %String)
SQL Query:
SELECT UserOrRole,RoleGranted,Grantable FROM Security.SQLRoleGrantOption WHERE (UserOrRole = :UserOrRole)
Given a User or Role name, return the roles and grant options for the roles granted directly to this UserOrRole
query List()
SQL Query:
SELECT UserOrRole,RoleGranted,Grantable FROM Security.SQLRoleGrantOption
Return the ID information for all SQL Role Grant Options


index (IDKey on UserOrRole,RoleGranted) [IdKey, Type = key];
Index methods: IDKeyCheck(), IDKeyDelete(), IDKeyExists(), IDKeyOpen(), IDKeySQLCheckUnique(), IDKeySQLExists(), IDKeySQLFindPKeyByConstraint(), IDKeySQLFindRowIDByConstraint()

Inherited Members

Inherited Methods


Storage Model: SQLStorage

Maps: 1

  • Map number 1 is named Master

    thismap.Global: ^*

  • ^*($e(("^|""^^"_$zu(12)_"""|SYS"),2,*),"Security","SQL","user-role",{UserOrRole},{RoleGranted})
    Node Delimiter Piece Name
FeedbackOpens in a new tab