Hi,
How can I revoke a role to a user.
I was trying something like this, but it doesn't make any sense to my the ObjectPermissionSet:
Dim Role As New ObjectPermissionSet
Role.Select = True
db_login.Revoke(Role, TextBox2.Text, False, False, "securityadmin")
Actually, the permission you're working with is a database role, not a permission in the strict sense. Try something like this:
Dim objDBRole As DatabaseRole
objDBRole = objDatabase.Roles("db_securityadmin")
objDBRole.DropMember(TextBox2.Text)
Hi,
Thanks, but how do I specify which is the database.
|||Hi,
Never mind is in objDatabase.Roles("db_securityadmin"). Thanks a lot.
Dim sRole As ServerRole
sRole = myServer.Roles("securityadmin")
sRole.DropMember(TextBox2.Text)
Dim dRole As DatabaseRole
dRole = sys_database.Roles("db_owner")
dRole.DropMember(TextBox2.Text)
No comments:
Post a Comment