Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sarathi_pm
Contributor II
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
Partner - Specialist III
Partner - Specialist III

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);

View solution in original post

4 Replies
amit_saini
Master III
Master III

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
Partner - Specialist III
Partner - Specialist III

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
Contributor II
Contributor II
Author

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
Partner - Specialist III
Partner - Specialist III

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: