-
Notifications
You must be signed in to change notification settings - Fork 4
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
updates consultant roles #2818
updates consultant roles #2818
Conversation
src/components/authorization/policies/by-role/consultant-manager.policy.ts
Outdated
Show resolved
Hide resolved
src/components/authorization/policies/by-role/consultant-manager.policy.ts
Outdated
Show resolved
Hide resolved
src/components/authorization/policies/by-role/consultant.policy.ts
Outdated
Show resolved
Hide resolved
src/components/authorization/policies/by-role/consultant-manager.policy.ts
Outdated
Show resolved
Hide resolved
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.
Your test failures are unrelated FYI
I think this has it all squared away now. Consultant + Consultant manager can see progress reports including the team updates, story and progress as members of a project Consultant manager can see any of these things for any Low or Medium sensitivity projects |
r.ProgressReport.when(member).read.children((c) => | ||
[c.teamNews, c.communityStories, c.highlights].flatMap((it) => it.read), | ||
), | ||
r.ProgressReportVarianceExplanation.when(member).read, | ||
r.ProgressReportTeamNews.read.specifically((p) => p.responses.read), | ||
r.ProgressReportCommunityStory.read.specifically((p) => p.responses.read), | ||
r.ProgressReportHighlight.read.specifically((p) => p.responses.read), |
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 believe what we want here is
[
r.ProgressReportCommunityStory,
r.ProgressReportHighlight,
r.ProgressReportTeamNews,
r.ProgressReportVarianceExplanation,
].flatMap((it) => it.when(member).read),
Your lines 26 is trying to be the same thing as 29-31. So we don't need both, and we prefer the non-children syntax for static parent cases.
The other difference is that 29-31 allows reading globally, instead of only if a member. Which I don't think is the intent.
Also I know we talked before about this, but the
.specifically((p) => p.responses.read),
shouldn't be needed as it's the same action permission as what the object level has.
Fixed here: #2853 (review) |
┆Issue is synchronized with this Monday item by Unito
PR for 4558680508