StanfordHCI/foundry — pull request #126 by dretelny (2014-12-03 02:19:11+00:00)
Title: Dr panelpw

I updated the panels/hiring portal so that only the author, project coordinators and clients can view them. In other words, the only "role" that shouldn't be able to view the panels/hiring portal is the worker role. For the most part, this isn't an issue since the hire button doesn't appear on the task modal for workers but they could have technically accessed these pages if they went to the urls directly.

For now, if a worker tries to access one of these pages, it throws a rails error. Ideally, it would redirect to the timeline or some sort of error page but I was having a bunch of issues with the redirect and decided it wasn't worth my time right now since it is unlikely workers will encounter this page to begin with.

Remember that there are two different views/ways to access the panels (check both when reviewing pull request):
1) The portal that loads when you click on the "hire" button in the task modal (not visible to workers)
2) localhost:3000/workers/index

To test:
1) Create a team and add a members with different "roles" (i.e. change their role in the member popover)
2) Make sure that in author view, you can still access all of the pages in both views and that you can add/edit members in the panel
3) Make sure that if you are in worker view, you can't access any of the pages in the 2 different views
4) Make sure that team members with roles set as "project coordinator" and "client" can access all of the pages in both views and that you can add/edit members in the panel
5) Change the role of one of the project coordinators or clients to "worker" and make sure you can't access either of the panel views (you might need to refresh the timeline page after changing the role since I am using sessions to keep track of the member role, I am not sure)