Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
dirk_fischer
Creator II
Creator II

Updating section access with partial reload does not overwrite old section access settings

Dear all,

we try to update our section access, when doing a partial reload. Attached is the code of the sample application, we use. If we run the code as full reload, everything works as expected. The user FISCHERD has access to the number 3 only.

If we run the same script as partial reload, the user FISCHERD has access to the numbers 3 AND 5 instead of 5 only.

 

Does anybody have an idea, where this is coming from and how to overcome this problem?

 

Thank you very much for your support.

 

Best regards

 

Dirk

 

ZAHLEN:
Replace Load * inline [ ZAHL, WORT, REDUCTION
1,  EINS, 1
2,  ZWEI, 2
3,  DREI, 3
4,  VIER, 4
5,  FUENF,5
6,  SECHS, 6
7,  SIEBEN, 7
8,  ACHT, 8
9,  NEUN,9
10, ZEHN,10
11, ELF,11
12, ZWOELF,12
13, DREIZEHN,13
14, VIERZEHN,14
15, FUENFZEHN,15
16, SECHSZEHN,16
17, SIEBZEHN, 17
];
 
/*
Call createBaseUserTable;
call DropTable('TEMP_ACCESS_TABLE');
Rename Table 'BASE_USER_TABLE' to 'TEMP_ACCESS_TABLE';
Exit Script;
Left Join(TEMP_ACCESS_TABLE)*/
If IsPartialReload() Then
TEMP_ACCESS_TABLE:
Replace NoConcatenate Load * Inline [ACCESS, USERID   ,REDUCTION
USER, ACCOUNTS\FISCHERD, 5
ADMIN, ACCOUNTS\SCHMIDRU,3
    ADMIN, ACCOUNTS\SCHMIDRU,5
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_API, 
];
Else
TEMP_ACCESS_TABLE:
Replace Load * Inline [ACCESS, USERID   ,REDUCTION
USER, ACCOUNTS\FISCHERD, 3
ADMIN, ACCOUNTS\SCHMIDRU,3
    ADMIN, ACCOUNTS\SCHMIDRU,5
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_REPOSITORY, 
ADMIN, INTERNAL\SA_API, 
];
End If
 
Section Access;
ACCESS_TABLE:
    NoConcatenate
    REPLACE LOAD * Resident TEMP_ACCESS_TABLE;
Section Application;
DropTable TEMP_ACCESS_TABLE;

 

Labels (4)
1 Solution

Accepted Solutions
TauseefKhan
Creator III
Creator III

Hi @dirk_fischer,

I think partial reload is not fully replacing the section access table with the new data. Explicitly replace the section access table during a partial reload to ensure that the new data completely overwrites the existing section access table.

Check with this steps:

//1- Your Data source.

//2- Clear the existing section access table
Section Access;
LOAD * INLINE [
ACCESS, USERID, REDUCTION
];

//3- Partial Reload
If IsPartialReload() Then

//4- Replace the section access table with the new data

Section Access;
LOAD * INLINE [
ACCESS, USERID, REDUCTION
USER, ACCOUNTS\FISCHERD, 5
ADMIN, ACCOUNTS\SCHMIDRU, 3
ADMIN, ACCOUNTS\SCHMIDRU, 5
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_API
];
Else
// Full Reload
Section Access;
LOAD * INLINE [
ACCESS, USERID, REDUCTION
USER, ACCOUNTS\FISCHERD, 3
ADMIN, ACCOUNTS\SCHMIDRU, 3
ADMIN, ACCOUNTS\SCHMIDRU, 5
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_REPOSITORY,
ADMIN, INTERNAL\SA_API
];
End If;

Section Application;

******** Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.********

View solution in original post

8 Replies
TauseefKhan
Creator III
Creator III

Hi @dirk_fischer,

I think partial reload is not fully replacing the section access table with the new data. Explicitly replace the section access table during a partial reload to ensure that the new data completely overwrites the existing section access table.

Check with this steps:

//1- Your Data source.

//2- Clear the existing section access table
Section Access;
LOAD * INLINE [
ACCESS, USERID, REDUCTION
];

//3- Partial Reload
If IsPartialReload() Then

//4- Replace the section access table with the new data

Section Access;
LOAD * INLINE [
ACCESS, USERID, REDUCTION
USER, ACCOUNTS\FISCHERD, 5
ADMIN, ACCOUNTS\SCHMIDRU, 3
ADMIN, ACCOUNTS\SCHMIDRU, 5
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_API
];
Else
// Full Reload
Section Access;
LOAD * INLINE [
ACCESS, USERID, REDUCTION
USER, ACCOUNTS\FISCHERD, 3
ADMIN, ACCOUNTS\SCHMIDRU, 3
ADMIN, ACCOUNTS\SCHMIDRU, 5
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_REPOSITORY,
ADMIN, INTERNAL\SA_API
];
End If;

Section Application;

******** Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.********

dirk_fischer
Creator II
Creator II
Author

Hi @TauseefKhan 

 

great, this did the trick.

 

Thank you very much for your help.

 

Best regards,

 

Dirk

dyy
Employee
Employee

I am trying to implement this for a partial reload for Section Access but, as soon as user presses the button to trigger the partial reload, all selections are CLEARED .  I believe it is because the user is no longer in that section access table for a brief moment as it cleared and replaced with the partial reload access table.  The selections need to be maintained after the partial reload for this process to work.  How can I ensure it does not clear the selections (NO , locking them does not work because that user does not have access to that data at that moment so it will clear selections for values that do not exist for that user.  Only the one island table selection is maintained as it is not part of the SA data model.

dirk_fischer
Creator II
Creator II
Author

Hi dyy

this is what I use. I have this sub for activating the section access and call it pretty much at the end of the script. Of course, you need to adapt your own access table and make sure the user has access to the data after section access activation. But for me this works without resetting selections.

Best regards,

Dirk

Sub ActivateSectionAccess
vStartOfSub = Now();
Let vTraceMsg = 'Start of sub activateSectionAccess at ' & Timestamp('$(vStartOfSub)', 'YYYY-MM-DD hh:mm:ss');
Trace '$(vTraceMsg)';

Call DropTable('ACCESS_TABLE');

Section Access;
Let vTraceMsg = 'Resetting the section access';
Trace '$(vTraceMsg)';
Replace Load
*
Inline [ACCESS, USERID, REDUCTION
]
;
Section Application;

Call TraceBeforeTableOp('Adding the default users to table ACCESS_TABLE', 'ACCESS_TABLE');
ACCESS_TABLE:
Add Load
ACCESS
,USERID
,REDUCTION
Inline [ACCESS, USERID, REDUCTION
ADMIN, INTERNAL\SA_REPOSITORY,
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_API,

dyy
Employee
Employee

Thank you got the quick response but I’m not understanding this solution.  I need this in a partial reload and this code does not look complete .  No end sub and calling other subs not defined  here .  What am I missing ? 

not sure what it is doing

dirk_fischer
Creator II
Creator II
Author

Good morning dyy

thank you very much for your feedback. I'm sorry for not removing the tracing part I usually add to my code. First I drop the table, where the access privileges are defined (in my case table ACCESS_TABLE). Then I reset the section access with the code below.

Section Access;
Let vTraceMsg = 'Resetting the section access';
Trace '$(vTraceMsg)';
Replace Load
*
Inline [ACCESS, USERID, REDUCTION
]
;
Section Application;

After resetting the section access, I define the updated access table.

ACCESS_TABLE:
Add Load
ACCESS
,USERID
,REDUCTION
Inline [ACCESS, USERID, REDUCTION
ADMIN, INTERNAL\SA_REPOSITORY,
ADMIN, INTERNAL\SA_SCHEDULER,
ADMIN, INTERNAL\SA_API,
USER, ACCOUNTS\DUMMY_USER, DUMMY_REDUCTION
];

After defining the updated access table, I activate the section access again.

Section Access;
Let vTraceMsg = 'Executing section access - ACCESS_TABLE now has ' & Num(NoOfRows('ACCESS_TABLE'), '#.##0') & ' datasets.';
Trace '$(vTraceMsg)';
Replace Load
*
Resident ACCESS_TABLE
;
Section Application;

And after activating the section access with the table ACCESS_TABLE, I drop the table again.

I hope, this is easier to understand.

Best regards,

Dirk

dyy
Employee
Employee

Thank you.  I  will attempt this once I make sense of it :-).  Would be great if I could see your entire script. 

Also can you tell me how this avoids the filter clearing that I am experiencing now with the partial reload.  I saw one post where they mentioned "make sure the USERID is fully available" .  But they do not define HOW you ensure it is fully available or what that even means.   I am at a loss on why the filters are cleared .  The filters for the island table is not cleared so it is definitely related to Section Access.  The only thing I can think of is for a minute that USER does not exist in the ACCESS table.   And it looks like your script also clears the ACCESS table for a moment which would result in clearing the filters from what I can see.

dirk_fischer
Creator II
Creator II
Author

Hi ddy

yes, the script clears the section access, but if you build the privileges correctly, the selection definitely will not get cleared.

You have to clear the section access, you can not modify the privileges. You have to clear them and then redefine them.

Does it work for you, if you do a full reload or are the selections cleared then as well?

Definitely the user needs to have the privileges after the partial reload or the selections will be cleared automatically.

 

I hope this helps.

 

BR

Dirk