-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/company team roles and invite flow #329
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
Conversation
…urces - Add userRole extraction from useCompanyContext hook across all company dashboard pages - Implement canManageEvents permission check based on user role (owner, admin, editor) - Conditionally render "Create Event" button and link only for users with manage permissions - Update event page descriptions to reflect user permissions (manage vs view-only) - Hide action column in events table for users without management permissions - Restrict event deletion, editing, and preview actions to authorized users - Apply same role-based pattern to hackathons and team management pages - Update empty state messaging based on user permissions and search context - Enhance TeamManagement component with role-based visibility controls - Improve CompanyDashboard with permission-aware feature access
…aging - Update page metadata title to "Subscription" and refine description - Replace hard redirect with conditional access control check for non-owners/admins - Implement dynamic page heading based on user permissions (Management vs Information) - Add conditional description text that reflects user's subscription access level - Allow all authenticated members to view subscription information while restricting management capabilities to owners and admins
…and display role Add conditional rendering for edit button based on user role and show user role in sidebar
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce role-based access control (RBAC) across company dashboard pages and components. Permission flags—such as canManageEvents, canManageTeam, and canManageSubscription—are derived from userRole and conditionally gate action buttons, admin UI elements, and messaging throughout the interface. The useCompanyContext hook now exposes userRole for permission checks. Changes
Sequence DiagramsequenceDiagram
participant User as User
participant Page as Dashboard Page
participant Context as useCompanyContext
participant UI as UI Elements
User->>Page: Load company page
Page->>Context: Extract userRole & currentCompany
Context-->>Page: Return userRole, currentCompany
alt userRole is owner/admin/editor
Page->>UI: Render Create/Edit buttons
Page->>UI: Show Actions column
Page->>UI: Display admin messaging
else userRole is member/viewer
Page->>UI: Hide Create/Edit buttons
Page->>UI: Hide Actions column
Page->>UI: Display read-only messaging
end
UI-->>User: Render permission-gated UI
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly Related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This pull request introduces role-based access control (RBAC) for companies, along with improvements to the invitation flow and access restrictions across key areas of the platform. These changes strengthen security, clarify permissions, and ensure a smoother onboarding flow for company teams.
✅ Key Features Added
🔐 1. Role-Based Access Control (RBAC) for Companies
👥 2. Team Invite & Access Flow Enhancements
🛂 3. Access Restrictions for Sensitive Routes
🛠️ Code Changes
🔍 Why This Matters
These updates ensure:
🧪 Testing
🔗 Closing
This PR lays the foundation for a secure and scalable company management system, improving RBAC, invite flow, and resource protection.
Authored by: @akshay0611
Summary by CodeRabbit
New Features
UI/UX Improvements