-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow WRC to make incident logs visible to staff only #10316
Comments
Hi, could I work on this issue please? |
Certainly! Please let us know if you need any help/guidance |
Hey, what do you mean by "Request email: "[WRC-WST] Incident Log Viewing Permissions"" Do you want me to add the option for them to send an email as well asking for permission?
|
That's the name of the internal email thread where the request came through - you can safely ignore it! |
Thank you! In addition, how would you suggest I detect if someone is a staff member, is there a table I can search through by ID to tell if they have the correct access? Also, the issue says "Allow WRC", in that case, how should the WRC make incident logs visible to only staff, should they be able to change it back and forth (request/toggle button) or allow for only specific incident logs to be visible by staff (can be set upon creating log)
|
(It is worth mentioning this is a non-trivial Rails change - it's definitely doable, especially with some coaching from ChatGPT, but if this is your first time touching Rails you might want to pick up a "good first issue" PR tagged with user.rb:464 defines a Within an incident log, we probably want a "Visibility" dropdown which allows selection between the following states: Then, in controllers/incident_log#show, you'll probably want some code that looks something like: # Note: This is completely pseudocode/has been written from memory - worth consulting the User model for the exact names of these methods, and ChatGPT for better ways of structuring this/how to check the value of an enum
redirect_to_root if visibility == 'draft' and !user.can_manage_incidents?
redirect_to_root if visibility == 'staff' and !user.staff? In terms of restricting this permission to WRC, you don't need to worry about that in the scope of this PR - the only people able to view an unpublished incident log at present should be WRC and admins. |
Ok, thank you! I believe I misunderstood the assignment originally and overcomplicated it by mistake. I apologise, the PR should be open right now. t you should be able to change each incident log by going through a drop-down menu inside them which only appears if you have permission to edit the incident logs. |
Request email: "[WRC-WST] Incident Log Viewing Permissions"
This could be done via a
visibility
enum which would replace theresolved_at
timestamp - enum could have the following properties:draft
staff
public
The text was updated successfully, but these errors were encountered: