Limiting users printing rights

J

Jens Letnes

Hello,
I have created a database that runs on the netwrok and
requires people to log in. There are many different users
as well as many different types of users. I need to
increase my security and am looking on how to limit
printing by certain users.

Does anyone know how to turn off the printing ability
for certain users but allow it for others (kind of like
what pdf's do)?

Thanks,

Jens
 
E

Eric

Hi,

Firstly, the last thing you're going to do is "Cancel" the
report loading (I'll explain later). Here's a snipet of
what you can use to identify a particular user and his/her
permissions. (I'm assuming that you have permission groups
already setup)

---------------------------------------------
'Variable used to identify the catalog that contains all
'user and there associated permissions.
Dim cat As New ADOX.Catalog
'Variable going to be used for indexing
Dim x, y As Integer

Set cat.ActiveConnection = CurrentProject.Connection

With cat
If .Users(CurrentUser()).GetPermissions(Null,
adPermObjView) <> adRightReadPermissions Then
Cancel = True
End
End If
End With
 
E

Eric

Please ignore my previous post. It does not function
properly. I'll give you the accurate code that function
correctly. I'm assuming you have groups already created.

-------------------------------------
'Variable used to identify the catalog that contains all
'user and there associated permissions.
Dim cat As New ADOX.Catalog
'Variable going to be used for indexing
Dim x As Integer

Set cat.ActiveConnection = CurrentProject.Connection

With cat
For x = 0 To .Users(CurrentUser()).Groups.Count - 1
If .Users(CurrentUser()).Groups(x).Name
= "AppropriatePermissionedGroup" then
Cancel = False
End
Else
Cancel = True
Endif
Next x
End With
-------------------------------------------------
Insert this code into the Report_Open() section of the
report. You could even create a function with this code
and just call it from the Report_Open() section.
Personally that's what I would utilize.

Hope this helps.

Regards,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top