Setting permission to a specific field

raja123
Member Posts: 50
Does anyone know if it is possible to restrict the access to a field and not to the entire table?
For example: Only user 'x' have access to all fields of the table, the others cannot have access to one of the fields of this table.
For example: Only user 'x' have access to all fields of the table, the others cannot have access to one of the fields of this table.
0
Answers
-
There is no such possibility in standard NAV. This can be implemented by modifications.
But the restriction on the reading of the field cannot be realized even with the modification.
If necessary I can describe the implementation in NAV 20171 -
Yeah, please explain me AlexeyShamin0
-
Small example for Update Event
1. Create Table for restricted fields. Table Fields:
User ID - Code(50)
Table ID - integer
Field ID - integer
Key - User ID, Table ID, Field ID
2. create subscription function. Event - Subscriber, EventPublisherObject - Codeunit ApplicationManagement, EventFunction - OnAfterOnDatabaseModify.
Function Parameters:
VAR RecRef - RecordRef
Function Variables:
FieldsRec - Record (Table from step 1)
xRecRef - RecordRef
FieldRef - FieldRef
xFieldRef - FieldRef
Code:
xRecRef.GET(RecRef.RECORDID);
FieldsRec.RESET;
FieldsRec.SETRANGE("User ID", USERID);
FieldsRec.SETRANGE("Table ID", RecRef.NUMBER);
IF FieldsRec.FINDSET THEN
REPEAT
FieldRef := RecRef.FIELD(FieldsRec."Field ID");
xFieldRef := xRecRef.FIELD(FieldsRec."Field ID");
IF FieldRef.VALUE <> xFieldRуf.VALUE THEN
ERROR('You do not have permission to change the field');
UNTIL FieldsRec.NEXT = 0;
1
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