%Library.SQLCatalogPriv
class %Library.SQLCatalogPriv
SQL Catalog Queries - PrivilegedMethod Inventory
Parameters
parameter SQLPUBLICSECURITY = {"SQLCatalogPriv_SQLUsers":"E"};
Methods
classmethod SQLAllPrivilegesClose(ByRef qHandle As %Library.Binary) as %Status
classmethod SQLAllPrivilegesExecute(ByRef qHandle As %Library.Binary, objectFilter As %String = "", privilegeType As %String = "", system As %Boolean = 0) as %Library.Status
classmethod SQLAllPrivilegesFetch(ByRef qHandle As %Library.Binary, ByRef Row As %Library.List, AtEnd As %Library.Integer) as %Library.Status
Queries
query SQLAllPrivileges(objectFilter="", privilegeType="", system=0)
Selects SUBJECT_NAME As %Library.String, SUBJECT_TYPE As %Library.String, PRIVILEGE_NAME As %Library.String, PRIVILEGE_TYPE As %Library.String, OBJECT_TYPE As %Library.String, OBJECT_NAME As %Library.String, GRANTED_BY As %List, HAS_GRANT_OPTION As %Library.String, GRANTED_VIA As %Library.String, HAS_COLUMN_PRIV As %Library.Boolean
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
%Library.SQLAllPrivileges() Procedure
%Library.SQLCatalogPriv:SQLAllPrivileges(system)
Returns all SQL privileges granted to the current user OR to any roles the current user holds.
If the current user holds %All or %Admin_Secure:USE, returns information about SQL privileges assigned to
all users/roles.
This query takes the following parameters:
objectFilter - Optional, default=""; For object privileges, limit the objects returned. The default
value will return all objects for the users/roles whose information the calling user is privileged
to see. This parameter offers limited wildcard support, where the filter may contain a
suffix of '*' to imply every name sorted after (and including) the given prefix. This filter
can include a fully qualified name, and a wildcard may appear in the schema and/or the table
portion of the name. Note that delimited identifier names that match the filter term take
priority over wildcard expansion. For example, the schema portion of 'sch*.tab*' will not be
expanded if there is a schema called 'sch*'; the same is true for the table portion. Matches
are considered on a case-insensitive basis. Any suffix after a wildcard is ignored for expansion,
but is considered valid if it directly matches an object name. For example, 'sch*ma.ta*le'
will match an object called 'sch*ma.ta*le' if it exists, but if no such object exists, then
it will be treated equivalently to 'sch*.ta*'. Any filter that does not include a period separator
is interpreted as a schema wildcard. Any object which the user is not privileged to view
will be skipped.
privilegeType - Optional, default='ALL'. Either 'ADMIN', 'OBJECT', or 'ALL'. If 'ADMIN', returns only
ADMIN privileges (e.g. %CREATE_TABLE). If 'OBJECT', returns only OBJECT privileges
(e.g. SELECT on ). Any value other than 'ADMIN' or 'OBJECT' is treated as 'ALL'.
system - Optional, default=0; Whether to include system tables/views (e.g. INFORMATION_SCHEMA tables).
ROWSPEC =
SUBJECT_NAME:%Library.String - Name of the user or role that has the privilege
SUBJECT_TYPE:%Library.String - USER or ROLE, depending on the specific subject for this privilege
PRIVILEGE_NAME:%Library.String - Privilege granted. Could be an object privilege (e.g. SELECT) or an admin privilege (e.g. %CREATE_TABLE)
PRIVILEGE_TYPE:%Library.String - Type of privilege granted. "ADMIN" or "OBJECT".
OBJECT_TYPE:%Library.String - TABLE, VIEW, STORED PROCEDURE, ML CONFIGURATION, FOREIGN SERVER, or NULL if this is an admin privilege
OBJECT_NAME:%Library.String - Name of the item for which the subject was granted privs on. NULL if this is an admin privilege
GRANTED_BY:%List - The user(s) that granted this privilege to the subject
HAS_GRANT_OPTION:%Library.String - "Yes" or "No" whether the user has GRANT option (or ADMIN option for admin privileges), allowing them to grant this privilege to other users
GRANTED_VIA:%Library.String - "Direct", "SuperUser", "Role: