-
Notifications
You must be signed in to change notification settings - Fork 409
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
Starting to enable supervolunteer role for #455 #476
Conversation
reopening |
const { roles } = this.props.data.currentUser | ||
|
||
// HACK: Setting params.adminPerms helps us hide non-supervolunteer functionality | ||
params.adminPerms = hasRole('ADMIN', roles || []) |
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.
This is an icky icky hack, but drastically simplifies the implementation here. I'm not sure if there is a way to do this better, but if not, I think it would be worth the hackiness to keep the rest of the code cleaner.
The reason this helps, is AdminDashboard is the wrapping route component for the other Admin pages, including side Nav, all of which need the property of whether the user is a full admin or not for the organization. The other pages, then just test against this.props.params.adminPerms
-- much easier than, e.g. all calling the same query in mapQueriesToProps (event if it's cached, that's a lot of code for a single property).
I think this completes the feature, though we should discuss the hackiness issue. |
Hey @schuyler1d - reviewing this PR. Thanks for finishing it off. Bugs found:
In the backend, I get this error:
|
thanks for review/testing! I'll take a look (this evening or tomorrow evening when I have my volunteer hat on :-) As to your incoming messages in 2.a -- the original request was that they see incoming messages: https://github.com/MoveOnOrg/Spoke/issues/455 -- even though I agree that it's sensitive info, I assume the idea is that it will relate to their supervolunteer role where they may review/monitor that queue the same way our supportcorps does for emails coming in. |
Ok, @shakalee14 check out the current updates.
|
|
hm. for 3. do you get an error server-side, or do you see anything odd about the graphql request? It's working for me with a test file. maybe we can pair at some point and see what's going on. |
error when i attempt to upload:
@schuyler1d - can you tell me the level of permissions you have for the admin user (where it works)? for example, the acct i'm using has the roles as 'OWNER', 'ADMIN', and 'TEXTER'. |
ok - i no longer see the error anymore - and it's working as expected! |
wip for #455
Things to do (for hiding things, it's dependent on the supervolunteer, but an admin should still see it):
src/lib/permissions.js
)