Skip to content
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

Project Workflow - PMs should not be able to bypass Consultant checks for Internships #3231

Closed
wants to merge 30 commits into from

Conversation

atGit2021
Copy link
Contributor

@atGit2021 atGit2021 commented Jun 6, 2024

CarsonF and others added 28 commits June 3, 2024 14:27
This means that a single transition can have multiple states
based on other things (like project state).
This opens the door for `from` field & generic abstraction
Disallow direct access to member values when referencing generically

```ts
let Color: MadeEnum<'red' | 'blue'>;
let AnEnum: MadeEnum<string>;
```
Without this change `Color` can't be assigned to `AnEnum`, because
the TS defines the member values as an index: `{ [x: string]: string }`.
So since one has an index accessor and one doesn't,
making them incompatible.

The `entry()` arg type change also allows them to be compatible.
Without it TS thinks something like `entry()` fn accepting any `string`
is not compatible with `entry()` fn only accepting `'red' | 'blue'`.
Using another generic at the function level somehow works around this,
while still maintaining all the strictness.
@atGit2021 atGit2021 requested a review from bryanjnelson June 6, 2024 22:49
@atGit2021 atGit2021 self-assigned this Jun 6, 2024
@atGit2021 atGit2021 requested a review from CarsonF as a code owner June 6, 2024 22:49
@atGit2021 atGit2021 removed the request for review from bryanjnelson June 6, 2024 23:41
@CarsonF CarsonF changed the base branch from develop to project-workflow June 7, 2024 13:08
@@ -23,6 +24,45 @@ export const IsMultiplication: Condition = {
},
};

export const hasValidRoleForProjectType: Condition = {
Copy link
Member

@CarsonF CarsonF Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an authorization concern, so the policies should handle it. We need to just figure out how to get the "internship type condition" there. Let me think about it.
I get that it's kinda weird since we have two ways and both have conditions.

src/components/project/workflow/transitions/conditions.ts Outdated Show resolved Hide resolved
src/components/project/workflow/transitions/conditions.ts Outdated Show resolved Hide resolved
@CarsonF CarsonF force-pushed the project-workflow branch 5 times, most recently from 84af753 to b2e86fa Compare June 11, 2024 03:54
Base automatically changed from project-workflow to develop June 12, 2024 18:52
@CarsonF CarsonF changed the title Project Workflow Condition - Validate Role Project Workflow - PMs should not be able to bypass Consultant checks for Internships Jun 18, 2024
@CarsonF
Copy link
Member

CarsonF commented Jun 18, 2024

This was actually implemented in 55777cd

@CarsonF CarsonF closed this Jun 18, 2024
@CarsonF CarsonF deleted the 0883-Internship-Workflow branch June 18, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants