In Access 2003, is there a way to get a list of table privileges (read, update, insert, delete) for a given group as defined in the security wizard.
All I can find around is security relationships between users and groups. That's the easy part.
Well, this is what I quickly hacked as a starting point. - Option Compare Database
-
Option Explicit
-
-
Function GetTablePrivilage()
-
Dim cat As ADOX.Catalog
-
Dim perm As Long
-
Dim Ws As Workspace
-
Dim i As Integer
-
Dim t As Integer
-
Dim db As DAO.Database
-
Dim mytbl As TableDef
-
Set db = CurrentDb
-
Open "C:\privileges.html" For Output As #1
-
-
Print #1, "<html><style>"
-
Print #1, "body{margin:0; padding:0;}"
-
Print #1, "table{border:1px solid black; border-collapse:collapse;}"
-
Print #1, "td {border:1px solid black; padding:0 4px 0 4px;}"
-
Print #1, "</style>"
-
Print #1, "<table>"
-
Set Ws = DBEngine.Workspaces(0)
-
Set cat = New ADOX.Catalog
-
With cat
-
For i = 0 To Ws.Groups.Count - 1
-
Print #1, "<tr><th colspan='3'>"
-
Print #1, "Group " & Ws.Groups(i).Name
-
Print #1, "</tr>"
-
For Each mytbl In db.TableDefs
-
If Left(mytbl.Name, 4) <> "MSys" Then
-
.ActiveConnection = CurrentProject.Connection
-
perm = .Groups(Ws.Groups(i).Name).GetPermissions(mytbl.Name, adPermObjTable)
-
If perm <> 0 Then
-
Print #1, "<tr><td>" & mytbl.Name & "</td><td>" & perm & "</td><td>" & privilegeToText(perm) & "</td></tr>"
-
End If
-
End If
-
Next mytbl
-
Next i
-
End With
-
Print #1, "<html><table>"
-
Close #1
-
End Function
-
-
Function privilegeToText(privilege As Long) As String
-
Select Case privilege
-
Case -2147482624
-
privilegeToText = "read data"
-
Case -1073740800
-
privilegeToText = "update data"
-
Case -2147449856
-
privilegeToText = "insert data"
-
Case -2147417088
-
privilegeToText = "delete data"
-
Case 1024
-
privilegeToText = "read design"
-
Case -1073672960
-
privilegeToText = "modify design"
-
Case -1072853760
-
privilegeToText = "administer"
-
Case -1073675264
-
privilegeToText = "delete & update data"
-
Case -1073642496
-
privilegeToText = "read, update, insert, delete"
-
Case -2147384320
-
privilegeToText = "read, insert, delete data"
-
Case -1072706304
-
privilegeToText = "Administer"
-
Case -1073708032
-
privilegeToText = "read, update, insert"
-
Case 147456
-
privilegeToText = "No privilege"
-
Case Else
-
privilegeToText = "NOT DEFINED"
-
End Select
-
-
End Function
1 1662 zmbd 5,501
Expert Mod 4TB
Mariostg:
This was a fairly difficult one one for me to find...
I think that you should be able to step thru the object using something along the lines of cat.getobjectowner(strObjectName, adpermobjtable) which is what I've done when checking users against a table...
for a fairly techie level of information on the security model try here: http://www.grahamwideman.com/gw/tech...ssec/index.htm
You should also take a look at what you can read here... look about page 356/357: http://books.google.com/books?id=TdJ...0group&f=false
-z
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ping |
last post by:
Hello,
Have a wonderful new year!
I have oracle 9.2 on XP.
There is a table T1 created by user U1 in U1's schema,
a synonym S1 created also by U1 to point to T1 in U1's schema,
U1 granted...
|
by: Tiffany Wilkes |
last post by:
I solved the problem--I needed ( ) around the column list. I think
the manual should make that more clear.
-------- Original Message --------
Subject: column privilege problem
Date: Tue, 05...
|
by: Michael Jackson |
last post by:
I have a stored procedure to create a table. In my program I want the user
to name the table to be created, therefore I pass a parameter to the SP for
the table name. I cannot get it to work.
It...
|
by: Sergey Suleymanov |
last post by:
Documentation says "By default, only the owner (creator) of the
function has the right to execute it."
But for me newly created function has execute privilege to
public by default. And we have...
|
by: xixi |
last post by:
There is one thing I don't understand, I have default tablespace
userspace1 is database managed type, with total freepages 506048.
another one called tmpxx is DMS type too, with 525120 free pages....
|
by: Jim |
last post by:
Hi,
I want to add a field to a table in a database that is live and being
accessed from the web. I'm using phpMyAdmin and when I try to add the field
I get error #1142...
|
by: shsandeep |
last post by:
I have given 'SELECT','INSERT' privileges to a user 'group' for a set of
tables.
But a user gets a prompt that he does not the 'SELECT' privilege on that
particular table. The user does belong...
|
by: %NAME% |
last post by:
Suppose I am an admin of a database instance. Now
I need to specify that user A has the right to create tables
in his own schema, but not anywhere else.
In order to let user A create tables, i...
|
by: prosad |
last post by:
hi!
Am having a problem inserting password after encrypting into a column of a table. am using MySQL.
$loginid = $_POST;
$password = $_POST;
$encrypt_password = md5($password);
if ($_POST)...
|
by: Rahul B |
last post by:
Hi,
I have a user UCLDEV1 which is a part of staff and a
group(db2schemagrp1) to which i have not given any permissions.
The authorizations of that user are shown as
db2 =get authorizations...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |