Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Stored procedures, triggers, batches, and user-defined functions » Procedures » Set procedures and functions to run with owner or invoker privileges » Running pre-16.0 system procedures as invoker or definer

 

Determining the security model used by a database (SQL)

Retrieve the security model setting (invoker vs. definer) that was specified at database creation or upgrade time by querying the Capabilities database property.

Prérequis

There are no prerequisites for this task.

Contexte et remarques

By default, a new database runs privileged system procedures using the INVOKER model only. This means that pre-16.0 system procedures that perform privileged operations execute with the privileges of the user invoking the procedure. This setting can be changed at database creation and upgrade time. You can determine the security model setting that was specified (invoker vs. definer) using this method.

 Task
  • In Interactive SQL, log in to the database and execute the following SQL statement:

    SELECT IF ((HEXTOINT(SUBSTRING(DB_PROPERTY('Capabilities'),1,LENGTH(DB_PROPERTY('Capabilities'))-20)) & 8) = 8)
    THEN 1
    ELSE 0
    END IF

Résultat

A 1 indicates that pre-16.0 system procedures that perform privileged operations are executed using the privileges of the invoker model. A 0 indicates that the procedures execute with the privileges of the definer (owner).

Suivant

None.

 See also