Reputation: 721
How do I get the granted permissions for a stored procedure in sybase?
Upvotes: 3
Views: 18119
Reputation: 1225
If I wanted to check the permissions for object "whatever_[table|procedure]", I would run the following query:
Example for "whatever" being a table
Displaying result for:
---------------------
select permission = a.name
from master.dbo.spt_values a
, master.dbo.spt_values b
, sysprotects p
, sysobjects o
where a.type = "T"
and a.number = p.action
and b.type = "T"
and b.number = (p.protecttype + 204)
and o.id = p.id
and o.name = 'whatever_table'
permission
----------------------------
References
Select
Insert
Delete
Update
5 Row(s) affected
Example for "whatever" being a stored procedure
Displaying result for:
---------------------
select permission = a.name
from master.dbo.spt_values a
, master.dbo.spt_values b
, sysprotects p
, sysobjects o
where a.type = "T"
and a.number = p.action
and b.type = "T"
and b.number = (p.protecttype + 204)
and o.id = p.id
and o.name = 'whatever_procedure'
permission
----------------------------
Execute
1 Row(s) affected
Upvotes: 3
Reputation: 33818
It depends on the form that you want that info in.
sp_helprotect proc_name
Then go to: Adaptive Server Enterprise 15.5/Reference Manual: Procedures, nd follow the explorer.
Upvotes: 6
Reputation: 2108
Adaptive Server Enterprise 15.5 > Reference Manual: Tables > System Tables
sysprotects
sysprotects contains information on permissions that have been granted to, or revoked from, users, groups, and roles.
Upvotes: 1