25 Replies Latest reply: Mar 7, 2018 2:30 PM by reshma k m RSS

    Reload Tasks

    reshma k m

      Hi,

       

      I need to enable a Qliksense developer to schedule Reload tasks in QMC. Could you please guide me how to achieve this? I tried creating a security rule, but it is not working for me.

        • Re: Reload Tasks
          Jerry Jackson

          I used this page (https://help.qlik.com/en-US/sense/1.1/Subsystems/ManagementConsole/Content/ServerUserGuide/SUG_ConfiguringSecurity_Envir…) as a guide to allow a user to create and run a task to reload an application.

           

          In the QMC rule, I only allowed access to the QmcSection_App,QmcSection_Task,QmcSection_ReloadTask sections.

            • Re: Reload Tasks
              reshma k m

              This is working. But I need a modification. Currently the user can access reload tasks created for apps in other streams. i have to restrict the user access by stream. ie, the user should only see the reload tasks created for his app stream. How can I do this?

                • Re: Reload Tasks
                  Jerry Jackson

                  In your reload security rule, you can limit access to the users apps.  Add something like:

                   

                  Resource Filter:  ReloadTask*,SchemaEvent*,CompositeEvent*

                  Actions: Read, Update, Delete

                  Conditions:

                  ((user.name="PUT_USER_NAME_HERE" and resource.app.owner.name="PUT_USER_NAME_HERE"))

                  or resource.resourcetype = "SchemaEvent"

                  or resource.resourcetype = "CompositeEvent"

                    • Re: Reload Tasks
                      reshma k m

                      Thanks for your quick response. I am trying to design something more general in nature. I am trying to create an "advanced developer" sort of role. you can find the details in the below thread.

                      Security framework - Sense QMC

                       

                      The proposed rule should enable users to perform the below activities. But your suggestions are welcome.

                      • View / Create Data connection, App, App Objects specific to their stream. Don’t see anything that doesn’t belong to their stream.
                      • Schedule reload task for the Apps in their stream.
                      • Create Custom properties and security rules.
                        • Re: Reload Tasks
                          reshma k m

                          Currently I am using a custom property for usertype (=developer) and a set of security rules. I have hard-coded only the stream name.

                          • Re: Reload Tasks
                            Jerry Jackson

                            Replace the user.name="PUT_USER_NAME_HERE" with the custom properties you created and change resource.app.owner.name ="PUT_USER_NAME_HERE" with resource.app.owner.name = user.name

                              • Re: Reload Tasks
                                reshma k m

                                I have modified the rule as below.

                                 

                                Resource filter: ReloadTask_*,SchemaEvent_*,Tag_*,CompositeEvent_*

                                Actions: create, read, update, delete

                                Conditions:

                                user.roles="StreamAdmin" and

                                resource.app.owner.name = user.name and

                                user.@usertype="Developer" and (resource.resourcetype="ReloadTask" or resource.resourcetype="SchemaEvent" or resource.resourcetype="CompositeEvent" or resource.resourcetype="Tag")

                                 

                                Note:

                                StreamAdmin is a new custom admin role created by a security rule.

                                usertype is a custom property.

                                 

                                 

                                Now the user can see only the tasks created by him. But it can't be scheduled and no new tasks can be created. In my requirement, he should be able to create and schedule reload tasks.

                                  • Re: Reload Tasks
                                    Jerry Jackson

                                    Because the Boolean logic of the rules is hard to understand, I created multiple rules.

                                    Create Task:

                                    Resource Filter: ReloadTask*,SchemaEvent*,CompositeEvent*

                                    Actions: Create

                                    Conditions:

                                    user.roles="StreamAdmin" and user.@usertype="Developer"

                                     

                                    Reload Task:

                                    Resource Filter: ReloadTask*,SchemaEvent*,CompositeEvent*

                                    Actions: Read, Update, Delete

                                    Conditions:

                                    user.roles="StreamAdmin" and

                                    resource.app.owner.name = user.name and

                                    user.@usertype="Developer"

                                     

                                    App:

                                    Resource Filter: Read

                                    Conditions:

                                    user.roles="StreamAdmin" and user.@usertype="Developer"  and (resource.owner.name = user.name or resource.App.HasPrivilege("read"))

                                     

                                    The HasPrivilege lets our users schedule apps that they see in shared streams.

                                      • Re: Reload Tasks
                                        reshma k m

                                        For App:

                                        what should be the rersource filter? App_* is enough?

                                          • Re: Reload Tasks
                                            Jerry Jackson

                                            These rules are only set for the QMC.  In my instance, to allow the user to see the applications the resource filter was App* not App_*.

                                             

                                            The create task rule should turn on the "Create" button, but not show any tasks.

                                             

                                            The reload task rule should let the user read, update and delete tasks that are related to apps that they own.

                                              • Re: Reload Tasks
                                                reshma k m

                                                Yes. It is working as expected. But a small problem is there. I am not able to create any trigger for scheduling tasks. Even if I create, it is not there the next time I open the task. I tried modifying the read-update-delete task to include the code below:

                                                ((user.roles="StreamAdminA" and resource.app.owner.name=user.name and user.@usertype="Developer" and (resource.resourcetype="ReloadTask" or resource.resourcetype="SchemaEvent" or resource.resourcetype="CompositeEvent")))

                                                 

                                                I modified the create task too. But it doesn't work.

                                                  • Re: Reload Tasks
                                                    Jerry Jackson

                                                    In the reload task rule, try:

                                                     

                                                    Condition: ((user.roles="StreamAdminA" and resource.app.owner.name=user.name and user.@usertype="Developer" ))

                                                     

                                                    The resource filter:  ReloadTask*,SchemaEvent*,CompositeEvent* should limit the part that I removed from the conditions.

                                                     

                                                    Actions should be read, update and delete.

                                                      • Re: Reload Tasks
                                                        reshma k m

                                                        I did that. As you said, The create task rule turned on the "Create" button, but not show any tasks.

                                                        The reload task rule let the user read, update and delete tasks that are related to apps that they own.

                                                         

                                                        The problem here is, the user can't create any triggers in the reload task.

                                                          • Re: Reload Tasks
                                                            Jerry Jackson

                                                            I went back and reviewed my test user and with the rules that you  have, it was able to create tasks with once and daily triggers.

                                                             

                                                            Do you get an error when you create a trigger, an error when you try to save the task or are you missing the options to create the triggers.

                                                             

                                                            Also, you should be able to create a task from the task menu and app menu (more options).  Do you get errors from both of these methods?

                                                              • Re: Reload Tasks
                                                                reshma k m

                                                                I was trying from Task menu. I am able to create a trigger, but it vanishes as soon as I hit "apply" and when I open the task again I don't see it. I tried from App menu, create new reload task is disabled/grayed out.

                                                                  • Re: Reload Tasks
                                                                    reshma k m

                                                                    I have the below tasks set up for this:

                                                                     

                                                                    name: TestCreateReloadTask

                                                                    resource filter: ReloadTask*,SchemaEvent*,CompositeEvent*

                                                                    actions: create

                                                                    conditions: ((user.roles="StreamAdminA" and user.@usertype="Developer"))

                                                                    context: only in QMC

                                                                     

                                                                     

                                                                    name: TestRUDReloadTask

                                                                    resource filter: ReloadTask*,SchemaEvent*,CompositeEvent*

                                                                    actions: read, update, delete

                                                                    conditions: ((user.roles="StreamAdminA" and resource.app.owner.name=user.name and user.@usertype="Developer"))

                                                                    context: only in QMC

                                                                     

                                                                     

                                                                    name: TestAppReloadTask

                                                                    resource filter: App*

                                                                    actions: read

                                                                    conditions: user.roles="StreamAdminA" and user.@usertype="Developer"  and (resource.owner.name = user.name or resource.App.HasPrivilege("read"))

                                                                    context: only in QMC