Read object permissions

jorgito
Member Posts: 115
Hi all.
Is there a function that can return if the user has permission on an object, other than a record (e.g form, report, codeunit)?
For example, to find out if a user has permission on a table, you would use READPERMISSION. Is there a similar way for the other objects (forms, reports codeunits)?
We have created a report that is a substitute to one of the standard reports. Some customers have access to this report and some others don't (because of the license each one has). We have a button on the Customer Card and we want to check if the user (through the license) has access to this object. If he has, show our report, otherwise, show the standard report. Right now, if the user does not have permissions, Navision displays the message "You do not have permission..." and displays nothing.
What can we do ?
Thank you in advance
Jorgito
Is there a function that can return if the user has permission on an object, other than a record (e.g form, report, codeunit)?
For example, to find out if a user has permission on a table, you would use READPERMISSION. Is there a similar way for the other objects (forms, reports codeunits)?
We have created a report that is a substitute to one of the standard reports. Some customers have access to this report and some others don't (because of the license each one has). We have a button on the Customer Card and we want to check if the user (through the license) has access to this object. If he has, show our report, otherwise, show the standard report. Right now, if the user does not have permissions, Navision displays the message "You do not have permission..." and displays nothing.
What can we do ?
Thank you in advance
Jorgito
0
Comments
-
There is no System function. but take a look to the Table "License Permission"Do you make it right, it works too!0
-
You are right!
I can search in the License Permission table to find if the license has permission on an object.IF Permissions.GET(Permissions."Object Type"::Report, 51000) THEN BEGIN IF Permissions."Execute Permission" = Permissions."Execute Permission"::Yes THEN // Run our report ELSE // Run the standard report END ELSE // Run the standard report
Thanks a lot0 -
You're welcomeDo you make it right, it works too!0
-
There is still one question: if the process request to run report A, but you will run report B because user have no permissions to report A, for me it could lead to inconsistent system. Better is to throw out the error and solve the case (assign missing rights to the user or change process). There will be only small count of cases when you will need to run different process based on permissions (I hope that this is one of them)... Do not implement this blindly, it could be hidden problem... :whistle:0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions