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

HKSID-270: fix project managers permissions #325

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

saijaseppa
Copy link
Contributor

@saijaseppa saijaseppa commented Feb 20, 2025

Note: this is still a draft. Waiting for refactoring for isInputDisabled (make a list of denied fields in form, and pass that list to components using isInputDisabled).

Description

Project manager is not allowed to delete projects.
Also fixed permission to fields budgetOverRun (forbidden), projectQualityLevel (allowed), planningPhase (allowed) and constructionPhase (allowed).

Ticket: https://futurice.atlassian.net/jira/software/c/projects/HKISD/boards/62?selectedIssue=HKISD-270
Related PR in backend: City-of-Helsinki/infraohjelmointi-api#245

Testing

Set the roles in backend: in file BaseViewSet.py modify the permission_classes so that it includes only the projectManager role. In frontend: in file AuthSlice.ts uncomment from the ad_groups the projectManager group. This will simulate the case when user has only projectManager role.

const projectGroup = groups.find(({ id }) => id === project.projectGroup);
if (data.projectClass !== projectGroup?.classRelation) {
data = { ...data, "projectGroup": null }
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only refactoring.

@saijaseppa saijaseppa marked this pull request as draft February 21, 2025 11:42
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.

1 participant