How can we allow a logged in user to see only (All the tasks assigned to him + other user's task if their task matches with Logging user task)

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have a middle table which contains many to many relationship of Users and tasks.Let us assume there are three users User 1, User2 and User3. And three tasks Task 1, Task 2 and Task3. User 1 is the logged in user.

1) Task 1 is assigned to User 1.

2) Task 2 is assigned to User 1.

3) Task 1 is assigned to User 2.

4) Task 3 is assigned to User 3.

Now according to requirement, User 1 can only see 3 records- Task 1 & Task 2 assigned to him and Task 1 assigned to User 2.

How can we implement this?

Photo of Arpana

Arpana

  • 82 Points 75 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
I'm confused here.  Are you trying to limit access to the records in the join table - the Task User Assignments?  Or to the tasks themselves?
Photo of Arpana

Arpana

  • 82 Points 75 badge 2x thumb
Sorry if my Question is not clear. I am trying to limit access to the records in the join table- the Task User Assignments.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
You can have a field called [Current User is on this Task Assignment (=1)] which calculates to a numeric 1 if the User is assigned to the task

ie 

[Assigned User] = User()

Then a Summary maximum up to the Task called [Task is Assigned to this User (=1)] which will be a 1 if the task is Assigned to this user.  Then look that up down to the Task Assignments table, and use that for either report filters or Role permissions in a Custom Rule.

I think for this to work, the User will need to have access to all Tasks, but maybe you can hide that table from their view, so they just live in the records of the Task Assignments. 


That approach will certainly work for report filters.  You will have to test to see if it also works as a Custom Rule in Permissions.  I have not tested, so there is the possibility that these permissions are sort of circular and they may not work.