Our application needs two types of users (every app users need their own credentials for database access)
- Admin
- General user
We have created a user General User
with the following permissions:
- Can browse stored procedures/function, but not allowed to to view code inside
- Can only select table, but not allowed to insert/update/delete outside of stored procedure execution
I have created a role and added General User
to it:
CREATE ROLE proc_executor
GRANT EXECUTE TO proc_executor
GRANT SELECT TO proc_executor
Now I need role for Admin
with the following permissions:
- Holds all roles of
General User
, which is already available - Create new users, both db and server
- Alter roles to add new users
There are some restriction for Admin
. They can only execute stored procedures and select from tables.
I researched, people have suggested to add role like db_accessadmin
, db_securityadmin
, sp_addrolemember
(not found) which is not sufficient to create new user and in same time breaks the restrictions.
It seems to be tricky to allow to create user permission and same time restrict to stroll stored procedure codes. Permission of SA holds with us, we can't allow client to play with database.
Can anyone help me out?