Re: SQL 2005 public role



Hi
Who is an owner of this SP?
Avoid adding logins to the public role. Grant an execution permission to the
stored procedure ( be aware if you are using dynamic sql within this sp ,
you'll have to grant permissions on underlying tables as well)



"Franky" <Franky@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:37C732BA-FAD2-43F8-A0EF-1F23383674B8@xxxxxxxxxxxxxxxx
I've made a stored procedure stp_LogError which will be used to have a
central errorhandling system.
(So in the usermade stored procedures in the catch-block stp_Logerror will
be used to log the error).
I've granted execute permissions for stp_LogError to the public role.
Afterward I added a NT-login to the server and added this login to the
role
public in the database.
I granted this user execute rights to a stored procedure in which
stp_Logerror is used.
When this user calls this stored procedure, this stored procedure
executes,
but when an error occurs we receive an execute permission denied on
stp_LogError for this user.

When I check the login for this user it is made a user in the database
through the role public.
When I check the role public in the database the user is not a member of
the role public.

I thaught that every user which is granted acces to a database is member
of
the public role, so when i granted execute rights for stp_logerror to the
public role, everyone (except the explicitly denied ones) would have
execute
rights on stp_LogError.

Can someone explain this to me


.



Relevant Pages

  • Re: SQL 2005 public role
    ... He can use EXECUTE AS in order to avoid granting permissions on the ... stored procedure (be aware if you are using dynamic sql within this sp, ... I've granted execute permissions for stp_LogError to the public role. ...
    (microsoft.public.sqlserver.security)
  • Re: Execute SP to access table with no select permissions
    ... create a stored procedure that runs the required ... Then just execute the SP from VB. ... > I have a stored procedure in the DB that the public role has execute privs ... This sp performs selects on 'refs' and returns a recordset to a VB ...
    (microsoft.public.sqlserver.security)
  • Re: SQL 2005 public role
    ... think it will be better to GRANT EXECUTE permissions rather using EXECUTE ... stored procedure (be aware if you are using dynamic sql within this sp, ... I've granted execute permissions for stp_LogError to the public role. ...
    (microsoft.public.sqlserver.security)
  • Re: SQL 2005 public role
    ... You don't need REVERT when you create a proc with the EXECUTE AS option. ... Columnist, SQL Server Professional ... stored procedure (be aware if you are using dynamic sql within this sp, ... I've granted execute permissions for stp_LogError to the public role. ...
    (microsoft.public.sqlserver.security)
  • Re: delete some user from the public role
    ... really my problem is related with a DTS execution. ... and when I try to execute the DTS from the ... I don't like to take out this 'denied' to the public role, ... > Jasper Smith (SQL Server MVP) ...
    (microsoft.public.sqlserver.security)