Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [Security] >  [SQLPrivileges]
Private  Storage   

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

Define the SQL Privilege mapping in the ^SYS global Mapping was added for SQL Privileges to take advantage of XML export

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
7 2 2 1


Summary

Properties
Grantable Grantee Grantor Namespace Privilege
SQLObject SQLPrivString

Methods
%AddToSaveSet %AddToSyncSet %CheckConstraints %CheckConstraintsForExtent
%ClassIsLatestVersion %ClassName %ComposeOid %ConstructClone
%Delete %DeleteExtent %DeleteId %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %Exists %ExistsId
%Extends %GUID %GUIDSet %GetLock
%GetParameter %GetSwizzleObject %Id %IsA
%IsModified %IsNull %KillExtent %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SerializeObject
%SetModified %SortBegin %SortEnd %SyncObjectIn
%SyncTransport %UnlockExtent %UnlockId %ValidateIndices
%ValidateObject Export Help Import
XMLDTD XMLExport XMLExportToStream XMLExportToString
XMLNew XMLSchema XMLSchemaNamespace XMLSchemaType


Properties

• property Grantable as %TinyInt(VALUELIST=",0,1") [ Required ];
Grantable - 1/0, can this privilege be granted by the user
• property Grantee as %String(MAXLEN=64,MINLEN=1) [ Required ];
Grantee - user/role the privilege was granted to
• property Grantor as %String(MAXLEN=64,MINLEN=1) [ Required ];
Grantor - user/role that granted the privilege
• property Namespace as %String(MAXLEN=256) [ Required ];
Namespace the privilege is defined in
• property Privilege as %String(DISPLAYLIST=",%ALTER,INSERT,UPDATE,DELETE,SELECT,REFERENCES,EXECUTE",MAXLEN=1,VALUELIST=",a,i,u,d,s,r,e") [ Required ];
Privilege assigned to the user/role
• property SQLObject as %String(MAXLEN=256) [ Required ];
ObjectType,ObjectName e.g. "1,Sample.Person" or "3,Sample.PersonView"
• property SQLPrivString as %String(MAXLEN=500,XMLPROJECTION="NONE") [ Calculated ];
SQL Privilege resource string

Methods

• classmethod Export(FileName As %String = "SQLPrivilegesExport.xml", ByRef NumExported As %Integer = 0) as %Status
This method exports SQL Object Privilege records to a file in xml format.
Parameters:
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 SQLPrivilege records from an xml file.
Parameters:
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

Queries

• query DirectPrivileges(UserRole As %String)
SQL Query :
SELECT Namespace,SQLObject,Privilege,Grantee,Grantor,Grantable FROM SQLPrivileges
WHERE (Grantee = :UserRole)
Given a User or Role name, return the ID information for the privileges that have been directly granted to the user or role
• query List()
SQL Query :
SELECT Namespace,SQLObject,Privilege,Grantee,Grantor,Grantable FROM SQLPrivileges
Return the ID information for all SQL Object Privileges

Indices

•index (IDKey on Namespace,SQLObject,Privilege,Grantee,Grantor) [IdKey];


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.