Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verifying user rights before opening an object

Status
Not open for further replies.

agc1976

Programmer
May 2, 2001
36
PR
Is it possible to verify if the user has rights to open a report (or form) before attempting to open it?

I have some reports that require the execution of very long procedures before opening the report. I don't want to make the user wait for the long procedure to finish executing and then tell him that he's not authorized to view that report...

Thank you
Alfred
 
Have you implemented user-level security? J. Jones
jjones@cybrtyme.com
 
Not sure what you mean by user level security, but if you mean that I will grant permissions to each user individually then no.

I plan to use groups and grant rights to those groups. Then assign users to those groups. Of course, I would want it to work if I assign the right to the user himself (just in case it's necessary).
 
I still haven't found a solution for my problem...

I have some looong SQL Server procedures that are executed before I open the reports (complex calculations that take a lot of time). These procedures are executed in a form I use to display the user all the available reports.

I want to be able to know, before the procedure executes, if the user has the right to open that report. This is to avoid making the user wait until the procedure is executed if he's not authorized to open the report.

It would be even better if I can just list the reports that the user is authorized to view...

Any ideas?
Thanks
Alfred
 
Look at thread181-123565 and thread705-120248

Aivars
 
That doesn't seem to help... what I need to be able to do is something like the following:


If UserHasPermissionForReport("ReportName") Then
ExecuteSQLStoredProcedure
OpenAccessReport
Else
MsgBox "You are not authorized to print the selected report."
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top