Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Sheet or App Object Level Security Qlik Sense

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitk1609
Master
Master

Sheet or App Object Level Security Qlik Sense

Last Update:

Aug 5, 2021 4:33:11 PM

Updated By:

rohitk1609

Created date:

Feb 2, 2017 2:16:53 AM

Hi Techies,

 

Qlik Sense QMC has great feature of QMC resource security where resource is like stream, application and master items(sheets, field, bookmarks, story etc) could be hidden from user or group of users. This document will guide you how to implement resource security in Qlik Sense from QMC to the deepest level which is app objects.

 

Qlik Sense security hierarchy: Stream => Application => App Objects (sheet, chart, dimension and measure)

 

My goal is to restrict an user to a particular Stream => application => sheet =>Chart( set of charts).

 

Note: There is nothing hard coded in Qlik Sense server, you can modify it anyhow by disabling the default rules and write your own custom rules.

Please avoid alter or deletion of any default security rule in QMC. Disable concern security rule and make a new one for testing or production use.

 

Security to MasterObject or AppObject is the deepest or bottom level security.

.

There are some names I am taking for this exercise:

User: JARVIS

Stream: Jarvis to Stream

Application: Consumer_Sales (Default application comes with installation of Qlik Sense Desktop) which has 5 sheets.

Sheet: Budget Analysis (This sheet which will be visible to our user or set of users only)

AppObject: charts, dimensions, measures, stories etc.

For next step:  =>

 

Implementation Steps:

1.    Install Qlik Sense server on your machine(Use a dedicated user as service user). Verify its prerequisites and enable it  license then  you will find two desktop shortcuts which are QMC and HUB. Please use local administrator account for installation.

 

1.    Open QMC with service account(by which you installed QSE) and go to User Directory Connector and create a new connector, if Active directory is there in network, select add path of AD (active directory), => remove checked sign from sync user data from existing users => click okay and click on SYNC button. You will see all the user will show in USERS tab. If you want to add local server users to Qlik, just hit the MachineName/HUB URL from the concern user and the same user name with machine name as USER DIRECTORY will appear to USER TAB in QMC.

 

3. Go to Apps tab import your any application (.qvf file), I am importing Consumer Sales(which comes by default with installation of Qlik Sense Desktop and quite famous across everyone ).

 

4.1 Go to security tab and disable default STREAM rule, This stream says The user should see the resource if he/she has read access to the stream it is published to  means if any user or group of user has READ access to the stream then user will see all the Application and AppObjects(All resources) so if we try to restrict any user to any particular application or App Object ,it will always let user to see everything which comes in the stream. So by disabling it we are taking all the access from user to see anything in stream by default.

 

4.2.   Create a new stream with name "Stream for Jarvis" then click on apply => It will give you a warning in yellow color for  not to  basic securities then click on cancel for not to apply any security rule or user at this time.(Please verify in Security Rule tab that no custom stream security rule is not built automatically )

 

5. Go back to Apps tab, make a duplicate of your application(We generally first make duplicate then publish to any stream because once we publish we can’t do any changes or development on the same application ).We will use the same application which was duplicated to new one for reload, Here I am making duplicate of Consumer_Sales app and renaming it to Consumer_Sales to Jarvis and publish it to stream Stream or Jarvis.

 

6 Now login with JARVIS (with the concern user), you will see there is no stream with name Stream for Jarvis. So, what is the problem. Problem is, User JARVIS doesn't have connection with Stream for Jarvis. So, we will use custom properties to associate a user to resource(Stream) or I can say we need to write a security rule which will say JARVIS can see the stream Stream for Jarvis. For basic knowledge of custom properties

https://help.qlik.com/en-US/sense/3.1/Subsystems/ManagementConsole/Content/custom-properties-overvie...

 

7. Go to Custom Properties tab, Create new  with name StreamLevelManagment with resource type Stream and User and give any  sample  value like  Assistant to it and assign to concern user(JARVIS)  by going to USERS tab , select JARVIS and on right side you will find custom property option , click on it and  then click on the space bar and you will see that sample value or what I took Assistant is appearing there select it  and do the same exercise for stream(Stream for Jarvis) by going to stream tab.

 

Custom Property.PNG

8 Now our task is to map Stream for Jarvis to user JARVIS by creating new security rule (Stream Template) as :

 

((user.@StreamLevelManagement=resource.@StreamLevelManagement))

 

I am describing security rules in Basic and Advance mode both to be sure you will not confuse how to make rule in both of Modes.

 

Now login with user JARVIS, you will find Stream for Jarvis.

  stream.PNG

I am describing security rules in Basic and Advance mode both to be sure you will not confuse how to make rule in both of Modes.

 

Now login with user JARVIS, you will find Stream for Jarvis.

 

9. Go back to Administrator, create a new custom property AppLevelManagment with resource type User and Apps then give a sample value to it and assigned this custom property to concern Users and Apps which you have been created for this exercise to make JARVIS can see the concern application as:

 

((user.@AppLevelManagment=resource.@AppLevelManagment))

 

Note: In this document, I am not focusing on ACTIONS under security rules such create, delete, publish, change owner etc. You need to concern for actions when client ask for it like my first set of user ca edit or duplicate sheet and do self service and another set of user can't.

 

10. Now you will see Jarvis Can see particular application but with all the sheets, but our goal is, to restrict JARVIS to only one sheet, for that create another security rule with App.object template and configure as:

 

((user.name="Jarvis" ) and resource.name="Budget Analysis")

Above rues says , user JARVIS can see Sheet type object and object is Budget Analysis. Now, login with JARVIS, you will see Jarvis see "Budget Analysis" sheet only.

Important point: Above security rule will disable all the sheets and you will see only "Budget Analysis" sheet, it means those sheet which will be published by your Qlik site member in same application under community section will not be visible to you.

 

Now if you wana your user see only see "Budget Analysis" sheet and those sheets which is shared by other users(when any user has rights to edit and publish a base sheet ) so here you need to write just opposite condition of what is written above as:

((user.name="Jarvis" ) and resource.name != "KPI Dashboard" and and resource.name != "Sales & Margin Analysis" and resource.name != "Sales Analysis" and resource.name != "Sales Rep Performance" and  resource.published="true")

 

Don't be so happy on this stage, JARVIS is restricted to only one sheet out of 5 sheets but when you open "Budget Analysis" sheet, JARVIS can't see any charts or objects and invalid object error message will be coming on the place of charts.

 

Here, you have two ways,

1. All the charts will be visible on that restricted sheet("Budget Analysis").

2. You want to restrict your user to any chart particular chart and hide other charts to user(JARVIS).

 

1. All CHARTS VISIBLE TO USER ON RESTRICTED SHEET

Let’s take all the objects (charts, filters) are supposed be visible on the "Budget Analysis" Sheet.

Create a new security rule:

 

1. ((user.name="Jarvis" or resource.name="*" and resource.objectType!="sheet"))

 

Then

 

2. ((user.name="User1" and resource.objectType="sheet"))

 

By above set of two security rule this User1  or JARVIS will see all the sheets on which he has access.

 

Here you need to write the above rule every time for each user to say user can see all the objects rather sheet its better to go with below instruction:

 

Important Note: Create a new rule with AppObject as resource type:

 

((resource.resourcetype = "App.Object" and resource.published ="true" and resource.objectType != "app_appscript" and resource.objectType != "loadmodel") and resource.objectType != "sheet" and resource.app.stream.HasPrivilege("read"))

 

Now, user can see all the charts are visible. First mile stone has been achieved.

Above rule says , anyone who has access to stream and published application, he can view all the application objects except sheet and for sheet you may use POINT NO 10 instruction. This rule will work for all the users , you just need to tell which user can see which sheet and lets say there are other users who can see all the sheets , then you may write one more rule here :

 

 

Now, the complex one, what if your client say, I wana my user will restrict to a sheet or set of sheets but he or she can see only one chart on the sheet and rest of the chart will be invisible.

 

ONLY ONE CHART WILL BE VISIBLE:

After step 10, next step :

Write security rule which grant access of App Objects of this sheet to JARVIS, Create a new security rule and configure it as JARVIS will see only one chart present in BUDGET ANALYSIS, by writing the code as:

((resource.objectType="masterobject" or resource.name="Sales $ by Product Group (sorted by Budget $)" or resource.name="Sales $" or resource.name="Product"))

 

If you can notice, Now I have taken concern all object Chart Name, Measure and Dimension which made that concern chart as resource.name.

Now you can see JARVIS can view only Sales $ by Product Group (sorted by Budget $) chart and rest are coming as Invalid Objects.

 

Jarvis.PNG

Important Note: Once you configured a Qlik Site for security every time whenever you add new user you have to give access for stream, application and objects(Sheets or Charts) in short need to update the custom security rules in QMC. New user by default can't see anything except STREAM if you add it to any stream as we do generally.

 

JARVIS stands for Just A Rather Very Intelligent System

 

After finishing Qlik Sense Enterpise , QAP(Qlik Analytical Platform) comes in picture which is for external users where number of users are in hundred and your client doesn't  want buy hundred of token so QAP is the right solution which has core base licencing.

You may get all the information step wise on the following document: QAP (Qlik Analytical Platform)

 

Other important Qlik Sense solutions:

  1. Dynamic Sheet Exception With Stream and App Level Security
  2. Best Practices of Qlik Sense Multi-Node Setup, Load Balancing & Maintenance(Let's Discuss Here) 
  3. How to Design Simple Linear Regression in Qlik Sense with help of Microsoft R(R Integration with Qli... 
  4. How to delete a sheet via Qlik repository API using Postman Desktop 

Reach out to me at kumar.rohit1609@gmail.com if there is need of any clarification or assistance 

Connect with me on LinkedIn  https://www.linkedin.com/in/rohit-kumar-67ba152b/

To get latest updates and articles, join Qlik community at  https://www.facebook.com/QlikIntellectuals

When applicable please mark the appropriate replies as ACCEPT AS SOLUTION and LIKE it. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as LIKE if you feel additional info is useful to others.

Labels (1)
Comments
rohitk1609
Master
Master

Hi Hannah,

Before doing this activity, first tell me your requirement as, how many streams are there, apps, user or set of users, what is the security use case ? When you share the details and if we find you have to disable STREAM rule(default one) or not. STREAM rule says who has access to any stream he or she can view all the apps and its content(sheets. charts, story). Disabling it means you have to write security rules by yourself for apps, stream and all other resources.It will be customizing things. Qlik has nothing static. You can modify it anyhow.

Best,

Rohit

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

0 Likes
hlines_usacs
Creator II
Creator II

Currently, we have 2 production streams with 5 apps overall that users are currently using. We have 5 other development streams used for just the developers. We have about 300+ users active accessing the apps, with the potential to have many more users.

In this case, I have one stream I will call ProdStream with one app I will call ProdDashboard. Our company has different regions (North, South, East, West). There is one sheet within the ProdDashboard I want to hide for the West region. My thought is to create two sheets (SheetA and SheetB). I want to hide SheetA for the West region so they only see SheetB. For North, South, and East regions, I want to hide SheetB, so they only see SheetA. (see below) Also, I would like to do this based on Active Directory group.

North - only see SheetA

South - only see Sheet A

East - only see SheetA

West - only see SheetB

0 Likes
rohitk1609
Master
Master

How apps has been distributed among two production streams and why do developer has different streams, If anyone want to do development it will happen in MY WORK section , are they publishing any dev app temporarily ?

0 Likes
hlines_usacs
Creator II
Creator II

I'm sorry, I misspoke. I have two streams what users are using. One is an Operations stream, and one is an RCM stream, and each cater to a different group of users. Yes, you are correct, where I only have a WORK section where I do the development, and the other streams are for apps for IT users only.

0 Likes
rohitk1609
Master
Master

Hi Hannah,

Sorry for replying delay!

First thing before implementing the security on object and disabling the STREAM default rule keep few things in mind:

1.If you are disabling default STREAM security rule, you may customize all level of hierarchy by yourself. Same is documented in above solution.

2. You may write a rule for user can access which stream, then which applicaton then which sheet or sheet or can be all.

3. You can use custom property but whenever new user will come you may apply custom property which you will make when you follow the document.

4. There will be no affect in MY WORK section apps but if your developer are publishing apps to any stream same thing you need to do.

5. An owner can see his apps in My work and published stream but If a developer want to show his app to another developer by publishing it to stream, you have to apply same custom property to other non owner.

Please start implementing security on any test server and if everything will work then put on production.

Best,

Rohit

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

0 Likes
Lisa_Sun
Support
Support

Hi Rohit,

At Step 10, I have written the rule like below, but still the user can see all charts in the sheet.  So basically which part is used to hide all charts in the sheet?  I only can see this rule grants access of the particular sheet to the user. 

((user.name="Jarvis" ) and resource.name != "KPI Dashboard" and and resource.name != "Sales & Margin Analysis" and resource.name != "Sales Analysis" and resource.name != "Sales Rep Performance")


Many thanks

Lisa

0 Likes
rohitk1609
Master
Master

Hey Lisa,

Let me tell you something, If you restrict a user from a chart, you need to prevent measure and dimension of that chart from user. Now what will happen, It will give you error of INVALID OBJECT, which looks very bad. Hiding chart can't overcome blank space or any other object. So I suggest don't do it because if you restrict any user from any dimension and measure it would affect globally.

Thanks,

Rohit

0 Likes
Carl_Hunter
Partner Ambassador
Partner Ambassador

Hi rohitk1609

Thanks for the guide, however, I'm a little confused about what I need to do...

My requirements are as follows:

1) The customer has multiple apps, in multiple streams

2) One of the apps requires sheet level security

3) The app has 5 sheets, however only certain users only should see 1 of the sheets

How would I go about setting this up?

0 Likes
rohitk1609
Master
Master

Hi Carl,

For your acquirement , this document is exact match. You need to create rules for three level, for stream and user, means which user will see which stream, then user app, means which user will see which app, then app objects where you will create two rules, which will give access of all app object to user and second access of one sheet(app object) to your restricted user.

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional .

Carl_Hunter
Partner Ambassador
Partner Ambassador

Hi Rohit, thanks, I'm still a little confused.

I understand the need for new rules, however, in your doc, you are hard coding peoples usernames and names of sheets, which I do not want to do. This needs to be a maintainable solution - this is where I am struggling to understand how to do?

Can you assist further?

0 Likes
Version history
Last update:
‎2021-08-05 04:33 PM
Updated by: