Options

Security in Fields

bbcaibbcai Member Posts: 80
Is it possible to set security for fields? Means people can only see certain fields data only. :?:

Comments

  • Options
    jmlozaresjmlozares Member Posts: 110
    Talkin' about the standard navision, the only way you to do this is to have some coding on the table where you want to limit acces of some certain users to a specific field. you can use USERID to check the user's identity then do some source code accordingly.

    Hope that helped! :D

    By the way, you can check-out the "Search the Forum" link above. I know there are existing discussions before that could help your concern.
    Janderol Lozares Jr.
    Manila, Phils.
  • Options
    krikikriki Member, Moderator Posts: 9,090
    A better way:
    Create a new group (=role). You don't have to add permissions.
    Instead of testing the users who can view the fields, use the groups who can see the fields.
    Then you can add the group the users who can see the fields (or even 1 field per group!). Once this has been programmed and you have to add a new user to see the field, just add the group to that user

    For the code in the "OnOpenForm"-trigger of the form:
    recMemberOf.RESET;
    recMemberOf.SETCURRENTKEY("User ID","Role ID",Company);
    recMemberOf.SETRANGE("User ID",USERID);
    recMemberOf.SETFILTER("Role ID",'%1|%2','SUPER','CANSEEFIELDX');
      // allows to see the field if the current user is a super-user or belongs the the group 'CANSEEFIELDX'
    recMemberOf.SETFILTER(Company,%1|%2','',COMPANYNAME);
      // allows to see the field if the current user can see the field in all companies or current company
    CurrForm."My Field".VISIBILE(recMemberOf.FIND('-'));
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.