Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Sunday, March 11, 2012

Database Role Security Permissions

Hi,

How can we determine permissions of a database role?

I could only find out how to determine user and login perms:

EXECUTE AS user = 'Omid' GO SELECT has_perms_by_name(db_name(), 'DATABASE', 'ANY') GO REVERT GOAny suggestions?I can't believe there is no reply after a day in MSDN forums. Anyway not to disappoint folks with the same problem, there is a very very stupid solution: Create a temp user(login) and add this user to the database role and then check the permissions and at last remove the user!|||

Hey, sometimes we all have to take a break Smile

Are you using 2005? If so, you can use the sys.database_permissions view. Here is a blog that I forgot that I wrote about this until I started doing some research for you Smile

http://drsql.spaces.live.com/blog/cns!80677FB08B3162E4!1485.entry

This query gets table permissions in a database, with object names... Easy enough to expand for other types of objects:

select database_permissions.permission_name,
coalesce(objects.type_desc,database_permissions.class_desc)
+ case when objects.type_desc is not null and minor_id > 0 then '-COLUMN'
else '' end as object_type,
case database_permissions.class_desc
when 'SCHEMA' then schema_name(major_id)
when 'OBJECT_OR_COLUMN' then
case when minor_id = 0 then object_name(major_id)
else (select object_name(object_id) + '.'+ name
from sys.columns
where object_id = database_permissions.major_id
and column_id = database_permissions.minor_id) end
else 'other' end as object_name,
database_principals.name as database_principal,
database_permissions.state_desc as grant_state
from sys.database_permissions
join sys.database_principals
on database_permissions.grantee_principal_id = database_principals.principal_id
left join sys.objects --left because it is possible that it is a schema
on objects.object_id = database_permissions.major_id
where database_permissions.major_id > 0
and permission_name in ('SELECT','INSERT','UPDATE','DELETE')
order by object_name

|||

I really appreciate it. Although I've already implemented the "stupid" solution, I'll surely change it to use the query as soon as possible.

Thanks again.

Friday, February 24, 2012

Database Read-only

When a database is retired and have to be read-only - only allow user to read tables under retired database however how I can grant to new user login into retired database with read-only. It won't me grant new user login. Only exist login id.
Thanks,
Mark
This problem is caused because the database is READ-ONLY. Meaning you can
not insert new users into the SYSUSERS table because it is READ-ONLY. I
might consider putting the database in DBO-USE-ONLY mode and then removing
the READ-ONLY, insert the new user and the place the database back into
READ-ONLY, and then remove the DBO-USE-ONLY usage. This will keep the
database from being update for normal users, but will also lock them out
while you are updating the database.
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Mark Call" <anonymous@.discussions.microsoft.com> wrote in message
news:9CCDB045-4AAD-453B-9BAC-24EFC40A976F@.microsoft.com...
> When a database is retired and have to be read-only - only allow user to
read tables under retired database however how I can grant to new user login
into retired database with read-only. It won't me grant new user login. Only
exist login id.
> Thanks,
> Mark
|||Thank you for suggestion.
Thanks,
Mark

Database Read-only

When a database is retired and have to be read-only - only allow user to rea
d tables under retired database however how I can grant to new user login in
to retired database with read-only. It won't me grant new user login. Only
exist login id.
Thanks,
MarkThis problem is caused because the database is READ-ONLY. Meaning you can
not insert new users into the SYSUSERS table because it is READ-ONLY. I
might consider putting the database in DBO-USE-ONLY mode and then removing
the READ-ONLY, insert the new user and the place the database back into
READ-ONLY, and then remove the DBO-USE-ONLY usage. This will keep the
database from being update for normal users, but will also lock them out
while you are updating the database.
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Mark Call" <anonymous@.discussions.microsoft.com> wrote in message
news:9CCDB045-4AAD-453B-9BAC-24EFC40A976F@.microsoft.com...
> When a database is retired and have to be read-only - only allow user to
read tables under retired database however how I can grant to new user login
into retired database with read-only. It won't me grant new user login. Only
exist login id.
> Thanks,
> Mark|||Thank you for suggestion.
Thanks,
Mark

Sunday, February 19, 2012

Database problems with loging into my site

I have build a ASP.NET website with a login form. I can create an account but I am not able to login into the site. I have checked the connection string. I have changed the database folder and moved files around to get the database runing from a different folder but it still wont work. ThanksTim

Which version of ASP.NET are you working with?

Which version of SQL Server are you working with?

Try copying the contents of your connection string to a expty text file, rename the file to X.UDL and double click on it. The connection dialog should appear. Click the test button.

|||

i am using VWD 2005 Express and I am hosting it using IIS 5.1 (Windows XP) as my server. I am working on Workframe 2