Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

section access using database connection

Hello,

I am able to get the section access up and running using the inline method. I want to transition this over to a database method so that way I can control the users through the database instead going into the script and adding/deleting rows from the inline. 

Here is my working script for the "IN LINE" method:

SECTION ACCESS;

LOAD * INLINE [

upper("access") as ACCESS,
upper("userid") as USERID,
upper("accessid") as ACCESSID
];

LOAD * INLINE [

ACCESS, USERID, ACCESSID
ADMIN, INTERNAL\SA_SCHEDULER, *,
ADMIN, ABC\124psu, *,
USER, ABC\124psu, M,
USER, ABC\124psu, A,

];

SECTION APPLICATION;

LOAD * INLINE [

ACCESSID, Organization

M, Marketing
A, Accounting
IT, IT
];

In this case, for testing purposes, I will only see data for Marketing and Accounting. And this is exactly what I want to achieve.

I've created 2 tables in my database to have the same column and values as the inline method above. When I bring these tables in, my script looks something like this ..

----------

section access;

LIB CONNECT TO 'demoDB(124psu)';

LOAD "ACCESS",
"USERID",
ACCESSID;
SQL SELECT "ACCESS",
"USERID",
ACCESSID
FROM "SAT"."USER_SECTION_ACCESS";

section application;

LOAD ACCESSID,
ORGANIZATION;
SQL SELECT ACCESSID,
ORGANIZATION
FROM "SAT"."USER_ORGANIZATION";

after executing the script I get this error message - "Access was denied after reload. Check that the user that reloads the script is included in the section access part of the script."

After some research, this usually stems from not including the internal scheduler and myself as an admin with an "*" but I have all those in place in my database tables.

I expect this to work the same as the inline method since I have the same column and values as the inline method. What am I missing here? 

Labels (1)
1 Reply
Highlighted
Creator II
Creator II

Quick update - I was able to get the script to execute and working using the database method.

 

section access;

LOAD upper("ACCESS") as ACCESS,
upper("USERID") as USERID,
upper(ACCESSID) as ACCESSID;
SQL SELECT "ACCESS",
"USERID",
ACCESSID
FROM etc

section application;

LOAD upper(ACCESSID) as ACCESSID,
ORGANIZATION as Organization;
SQL SELECT ACCESSID,
ORGANIZATION
FROM etc