-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
refactor: split Staff Dev role into separate roles, add CM vanity role #2972
base: master
Are you sure you want to change the base?
refactor: split Staff Dev role into separate roles, add CM vanity role #2972
Conversation
app/Models/Role.php
Outdated
@@ -145,7 +160,7 @@ public static function boot() | |||
if ($relationName === 'users') { | |||
foreach ($pivotIds as $pivotId) { | |||
$user = User::find($pivotId); | |||
activity()->causedBy(auth()->user())->performedOn($user) | |||
activity()->causedBy($user)->performedOn($user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$user
is overloaded here. it's already defined on line 162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed in latest. I also added some safeguards to prevent server errors in case these code paths are entered from side effects (ie: a command, Horizon job, etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you removed the assignment of $user=Auth::user()
, but this statement previously was causedBy(auth()->user())
and now it's causedBy(User::find($pivotId))
.
The same change occurs a few lines up (151).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what's happening now. I got confused.
I try to replace those auth()->user()
calls with Auth::user()
-- for some reason my IDE yells about auth()->user()
. I think we should be in a good place now with changes in latest.
…/RAWeb into staff-dev-role-split
This PR repurposes the currently-unused Staff Developer role, splitting it into the three staff dev roles that have emerged since the original permissions matrix was envisioned. Those roles are:
Each of these three roles has distinct responsibilities, and should ultimately have distinct abilities. There is enough nuance in their day-to-day that this split should occur.
Also, the way Staff Developer was written implied that a user would be promoted from Developer to Staff Developer. However, in practice, QAM/DevC/CR are additive to Developer, giving that Developer additional privileges. A full developer may have 1 to N of these three roles.
Additionally, a new vanity role has been added: Community Manager. This can be attached to users, but it should not have any abilities. A Community Manager should inherit abilities from other roles like Moderator, etc.
SQL commands to run:
Things to note regarding this PR: