Qlik Community

QlikView Security & Governance

Discussion Board for collaboration on QlikView Security and Governance.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
sarathi_pm
New Contributor II

Section access for Objects security based on field criteria

Hi

I have a scenario where i need to secure an object based on a field (Country)

my section access code is:

SECTION Access;

LOAD ACCESS,

     NTNAME

FROM

[\Data\User Access\User Access.xlsx]

(ooxml, embedded labels, table is Sheet1);

ChartAccessMatrix:

LOAD * INLINE [

NTNAME, CH01, CH02, Country_view

USER1,1,1,INDIA

USER2,1,1,CHINA

USER3,1,1,JAPA

];

NTNAMEACCESS
USER1ADMIN
USER2USER
USER3USER

Could you please suggest me how to apply a condition so that the object is visible only the user matches with the country.

Thanks

Sarathi

1 Solution

Accepted Solutions
MindaugasBacius
Valued Contributor II

Re: Section access for Objects security based on field criteria

I would make little different.

Create two tables see the attachment:

Screenshot_1.jpg

Screenshot_2.jpg

The field Country have to be in your data model and have to be connected to the fact table.

In the script I would use these statements:

Section Access;

LOAD ACCESS,

     NTNAME,

     ROLE

FROM

[Source]

(ooxml, embedded labels, table is ACCESS);

Section Application;

PERMISSIONS:

LOAD ROLE,

  Country

FROM

[Source]

(ooxml, embedded labels, table is PERMISSIONS);

4 Replies
amit_saini
Honored Contributor III

Re: Section access for Objects security based on field criteria

Hi ,

You can try something like below , change Plant by Country based on ur requirement.

Section Access;

Access:

LOAD ACCESS,

     NTNAME,

     upper(PLANT) as PLANT

FROM

[...\Flatfiles\Section_Application_Plant.xlsx]

(ooxml, embedded labels, table is WeeklyOPs)

where 1=1;

Section Application;

PlantAccess:

load

    upper(PLANT) as PLANT,

    PLANT as Plant

FROM

[....\Flatfiles\Section_Application_Plant.xlsx]

(ooxml, embedded labels, table is WeeklyOPs)

where 1=1;

and maintain excel like below:

Thanks,

AS

MindaugasBacius
Valued Contributor II

Re: Section access for Objects security based on field criteria

I would make little different.

Create two tables see the attachment:

Screenshot_1.jpg

Screenshot_2.jpg

The field Country have to be in your data model and have to be connected to the fact table.

In the script I would use these statements:

Section Access;

LOAD ACCESS,

     NTNAME,

     ROLE

FROM

[Source]

(ooxml, embedded labels, table is ACCESS);

Section Application;

PERMISSIONS:

LOAD ROLE,

  Country

FROM

[Source]

(ooxml, embedded labels, table is PERMISSIONS);

sarathi_pm
New Contributor II

Re: Section access for Objects security based on field criteria

Hi,

Thanks for your reply. I tried your option and its working.

Unfortunately, only the users with ADMIN access are able to open the qlikview document and the users with USER access are not able to open the file. it throws error "Access Denied to open the document'

But when i change the access to Admin, the users are able to open the file.

Any idea why is this happening?

Thanks

Sarathi

MindaugasBacius
Valued Contributor II

Re: Section access for Objects security based on field criteria

I am not sure. I can only guess that the issue appears in:

  • QMC
  • QV application > Settings > Document properties > Security

Please check this blog post:

Community Browser