Integrated security and permissions

  • Thread starter Thread starter Tom Lee
  • Start date Start date
T

Tom Lee

How can I from a adp file using integrated security for the connection, get
the permissions for the current user?

Tom L.
 
If you use MSDE2000, you can not do MSDE/SQL Server security management,
except for execute SPs that change/set security settings in MSDE/SQLServer.
That is, no GUI available. If you still use MSDE1.0, then ADP (At lease
Access2K) provides the same SQLServer user account/login management GUI as
Enterprise Manager.

So, if you are very familiar with those related SPs, you can execute it
inside ADP. Otherwise you need a user-friendly GUI tool (Enterprise Manager)
to do that.
 
Actually I using SQL Server 2000 Std. I was hoping to programatically
determine the permissions for the user so I could communicate their level of
access on forms.

Tom L.
 
Tom,

One approach is to query the INFORMATION_SCHEMA views.

I recommend it, and do so myself. This allows, for instance, dynamically setting a form's .AllowEdits, AllowAdditions,
..AllowDeletions properties based on the users privs on the the forms underlying table (.UniqueTable), and furthermore dynamically
setting controls .Locked property based on column level grants. (all this with color coded feedback, i.e. lock fields are orange)

For instance, here is one sp my app framework (I call it 'SAF') uses:

ALTER PROCEDURE dbo.p_SAF_TABLE_PRIVILEGE
(@TABLE_NAME nvarchar(128))
-- select the names of privileges the current user has on @TABLE_NAME. Note that if COLUMN_PRIVILEGES have been individually
granted, the
-- TABLE_PRIVILEGES does not return 'UPDATE', thus the UNION with the COLUMN_PRIVILEGES view
AS SELECT
dbo.INFORMATION_SCHEMA_TABLE_PRIVILEGES.PRIVILEGE_TYPE
FROM dbo.INFORMATION_SCHEMA_TABLE_PRIVILEGES
WHERE dbo.INFORMATION_SCHEMA_TABLE_PRIVILEGES.TABLE_NAME = @TABLE_NAME

union
select dbo.INFORMATION_SCHEMA_COLUMN_PRIVILEGES.PRIVILEGE_TYPE AS Expr1
from dbo.INFORMATION_SCHEMA_COLUMN_PRIVILEGES
where dbo.INFORMATION_SCHEMA_COLUMN_PRIVILEGES.TABLE_NAME = @TABLE_NAME


Regards,
 
Back
Top