Monday, 18 April 2011

Blocking user access to a field using OMIT

This is something that comes up every so often.  A question like, "we have sensitive data (such as salary!) in our system that we only want some users to see".

This is all very straightforward on SBS where collaboration is not available.  Simply lock down the tab which has the sensitive data displayed using, for example, a condition based on the OSUser() function.

On an Enterprise server, where users can create their own objects, you don't want them to even see that the field is there.

We can achieve this using the OMIT field in Section Access.  At a simple level, if you only have one field to hide, you can have the OMIT in the main Section Access table.  If you want to perhaps OMIT several fields, then the creation of a group of fields is the thing to do and then just link the user to the group ID.

In the example below, when user1 logs in they will not see Field1 or Field2.  When user2 logs in, they will not see Field2 or Field3.



Section Access;
LOAD * INLINE [
    ACCESS, USERID, OMITGROUP
    ADMIN, admin, 
    USER, user1, group1
    USER, user2, group2
];


LOAD * INLINE [
    OMITGROUP, OMIT
    group1, Field1
    group1, Field2
    group2, Field2
    group2, Field3
];




Section Application;


Fields:
LOAD * INLINE [
    Field1, Field2, Field3, Field4, Field5
    Value1, Value2, Value3, Value4, Value5
];



Stephen Redmond is CTO of CapricornVentis a QlikView Elite Partner

5 comments:

  1. Thanks for that! :)

    /dimi

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete
  4. I made a reference to your great blog at integration.qlik.com/slides if you don't mind?

    ReplyDelete