hydrorocks
Programmer
Hi,
I don't know if it is possible, but I need to give certain Users the right to add or drop other users to roles. I would need a procedure which will simplified look like this:
CREATE PROCEDURE dbo.add
AS
EXEC sp_addrolemember 'role', 'user'
GO
The Problem is, that no User can execute this procedure, even if he has the permission for this procedure because for sp_addrolemember you need the db_owner role. I don't want to give all user the db_owner role, only users with the role for this procedure should be allowed to use it.
My Question: Can I create a procedure, which grants db_owner rights for a user only for this one procedure. Like say, everybody who is allowed to use this procedure is allowed to use this procedure and only this procedure as db_owner?
Any help would be appreciated, and sorry for my english...
)
Hydro
I don't know if it is possible, but I need to give certain Users the right to add or drop other users to roles. I would need a procedure which will simplified look like this:
CREATE PROCEDURE dbo.add
AS
EXEC sp_addrolemember 'role', 'user'
GO
The Problem is, that no User can execute this procedure, even if he has the permission for this procedure because for sp_addrolemember you need the db_owner role. I don't want to give all user the db_owner role, only users with the role for this procedure should be allowed to use it.
My Question: Can I create a procedure, which grants db_owner rights for a user only for this one procedure. Like say, everybody who is allowed to use this procedure is allowed to use this procedure and only this procedure as db_owner?
Any help would be appreciated, and sorry for my english...
Hydro