Sybernet / Supplied Procedures Reference
Release 3.00
Dec 18, 2005
backwards forwards

SYBSYSTEMPROCS.SP_SYSPROTECTS

This procedure is used by Sybernet to determine if execute permission has been granted to a user. The advantage of using a stored procedure means you can select the permission on any object from any database. Sybernet does not assume everyone belongs to group "public." This is different from Sybase's interpretation. If you disagree, and you wish Sybernet to check the permissions in public as well, change the default for checkPublic to 1.

Syntax

procedure sp_sysprotects
(
    @procname                      varchar(92)
,   @checkPublic                   int               = 0
,   @id                            int               = null output
,   @uid                           int               = null output
,   @action                        smallint          =  224 output
,   @protecttype                   tinyint           = null output
,   @columns                       varbinary(133)    = null output
,   @grantor                       int               = null output
)

Parameters

Parameter Description
procname
 
Object to be examined. This name should be fully qualified if this object resides in another database.
checkpublic
 
Determines if public access is okay.
action
 
The type of permission you are looking for (224 is execute permission).
protecttype
 
Determines if this permission is granted or revoked:
  • 0 (granted)
  • 1 (granted)
  • 2 (revoked)
A value of NULL means not granted or this object does not exist or this database is offline.

Example

The following example illustrates how to call SP_SYSPROTECTS:

declare
    @protecttype tinyint
begin
    exec sp_sysprotects

        @procname = 'http.dbo.sp_html_who'
    ,   @protecttype = @protecttype output

    if (@protecttype=0) or (@protecttype=1)
        select 'Granted!'
    else
        select 'Not granted!'
end


See Also

SP_CRON_INSERT
SP_HTML_LOGIN
SP_SYSCOLUMNS
SP_SYSOBJECTS



Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/