feat: enhance permissions for workplace and academic supervisors in U…#230
Conversation
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughUserDetailView.get_object now enforces supervisor-specific access: WORKPLACE_SUPERVISOR and ACADEMIC_SUPERVISOR may view a target user only when an InternshipPlacements record links the supervisor to that intern; otherwise access is denied with a role-specific PermissionDenied. Changes
Sequence Diagram(s)sequenceDiagram
participant Requester as Requester (supervisor)
participant View as UserDetailView
participant DB as InternshipPlacements DB
participant Target as Target User
Requester->>View: GET /users/{id}
View->>DB: query placement where intern=Target and (workplace_supervisor=Requester OR academic_supervisor=Requester)
alt placement found
View->>Target: return user object
View-->>Requester: 200 OK (user data)
else no placement
View-->>Requester: 403 PermissionDenied (role-specific message)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Review rate limit: 1/3 review remaining, refill in 34 minutes and 43 seconds. Comment |
Deploying logify-frontend with
|
| Latest commit: |
17b5c44
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://649ba184.logify-frontend.pages.dev |
| Branch Preview URL: | https://fix-unknown-intern.logify-frontend.pages.dev |
…serDetailView