platelet-app / platelet

Dispatch system for emergency volunteer couriers.
https://platelet.app
Apache License 2.0
38 stars 10 forks source link

Role based restrictions on task overview #38

Closed duckbytes closed 2 years ago

duckbytes commented 2 years ago

The task overview should only allow certain actions for someone that is assigned to it as a rider compared to a coordinator.

The rider should only be able to update items under the Actions panel.

The React Context feature may be good for this so that checks don't need to be made in each component.

https://reactjs.org/docs/context.html

duckbytes commented 2 years ago

Looking at what permissions should be allowed for users when looking at an individual task.

At the moment I have something working with these checks:

We could also go with the simpler:

This means if a coord was looking at a task not assigned to them, they would need to assign themselves as a coordinator (or rider) to make changes.

There's also no restriction on writing comments or assigning users to a task (except someone without the appropriate role can't be assigned, i.e. a rider can't assign themselves as a coordinator unless they have the coordinator role, but could assign themselves as a rider).

For demonstration: Full access.

image

Rider access:

image

No access:

image

@PaulFreewheelersEVS can you have a look please and let me know what you think?

PaulFreewheelersEVS commented 2 years ago

Hi Theo

I am struggling to get my head around this. Is it possible to have an environment where I can log in with the three access levels and try it out?

Thanks Paul

From: Theo @.> Sent: 30 June 2022 20:56 To: platelet-app/platelet @.> Cc: PaulFreewheelersEVS @.>; Mention @.> Subject: Re: [platelet-app/platelet] Role based restrictions on task overview (Issue #38)

Looking at what permissions should be allowed for users when looking at an individual task.

At the moment I have something working with these checks:

We could also go with the simpler:

This means if a coord was looking at a task not assigned to them, they would need to assign themselves as a coordinator (or rider) to make changes.

There's also no restriction on writing comments or assigning users to a task (except someone without the appropriate role can't be assigned, i.e. a rider can't assign themselves as a coordinator unless they have the coordinator role, but could assign themselves as a rider).

For demonstration: Full access.

https://user-images.githubusercontent.com/32309223/176765337-f7f86f1f-62fb-4bc0-8971-7d85f690a8f9.png

Rider access:

https://user-images.githubusercontent.com/32309223/176765526-41cbe277-08a0-4193-a794-478dacbdec57.png

No access:

https://user-images.githubusercontent.com/32309223/176765509-8bcce7e0-cc4d-4951-b1d5-ff59feafa7fc.png

@PaulFreewheelersEVS https://github.com/PaulFreewheelersEVS can you have a look please and let me know what you think?

— Reply to this email directly, view it on GitHub https://github.com/platelet-app/platelet/issues/38#issuecomment-1171618893 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AYPZ2XDYNE65SBHCR2KOLC3VRX3V7ANCNFSM5QHSUCPQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AYPZ2XAOUXDGWIMU7DIVV2DVRX3V7A5CNFSM5QHSUCP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIXKXYTI.gif Message ID: @. @.> >

duckbytes commented 2 years ago

Hi @PaulFreewheelersEVS

You can try the demo build:

https://demo.platelet.app

Switch between the different views on the dashboard and assign or unassign the demo user to any job as the different roles to see how the UI changes.