I am using the REST API with Authorization enabled.
When I call in to the REST API with “/task” I get tasks that task that I the current authenticated user is not assigned to. Specifically, the problem is with the authentication query:
SELECT DISTINCT
*** lots removed***
FROM ACT_RU_TASK RES
LEFT JOIN ACT_RE_PROCDEF PROCDEF
ON RES.PROC_DEF_ID_ = PROCDEF.ID_
LEFT JOIN (SELECT A.*
FROM ACT_RU_AUTHORIZATION A
WHERE A.TYPE_ < 2
AND ( A.USER_ID_ IN ( ‘tester’, ‘’ )
OR A.GROUP_ID_ IN ( ‘non-admin’ ) )
AND (( A.RESOURCE_TYPE_ = 7
AND A.PERMS_ & 2 = 2
OR A.RESOURCE_TYPE_ = 6
AND A.PERMS_ & 64 = 64 ))) AUTH
ON ( AUTH.RESOURCE_ID_ IN ( RES.ID_, PROCDEF.KEY_, '’ ) )
WHERE ( ( RES.CASE_EXECUTION_ID_ IS NOT NULL )
OR ( AUTH.RESOURCE_ID_ IS NOT NULL ) )
AND ( RES.TENANT_ID_ IS NULL )
ORDER BY RES.ID_ ASC
LIMIT 2147483647 offset 0 ;
based upon this…
ON ( AUTH.RESOURCE_ID_ IN ( RES.ID_, PROCDEF.KEY_, ‘*’ ) )
will filter out tasks where the the Resource Id in the Auth is either equal to RES.ID_ (which is the task Id), the process definition id or *, which I am assuming is some sort of admin or “all” resource.
This would mean that we would need to know the task id ahead of time and assign an authorization for it. This doesnt really make sense and this doesn’t support a really common use case where you want to return only the tasks that use is assigned to.
To support this, this query would have a join on clause that looked something like this:
ON ( AUTH.USER_ID_ = RES.ASSIGNEE_ OR RES.ASSIGNEE_ in(‘non-admin’,‘testers’ ) )
This would only include tasks that where equal to the task is assigned to the user or the user has one of the groups in which the task is assigned to.
This relates to this problems-with-authorization where the question was never really answered.
My question is the same:
“Do I really have to set a Authorization for each known task in the system (set taskActivityId as Resource_Id) or is there an other way to achieve my goal?”