-
Notifications
You must be signed in to change notification settings - Fork 0
Privilege Guidelines
This document defines roles, permissions, and access control within Codex Web. Understanding these guidelines is essential for proper user management and security.
Platform Admin (Highest Privilege)
│
├─> Full platform access
├─> All admin operations
└─> Unrestricted resource access
Group Admin (Group-Scoped)
│
├─> Manage workspaces in assigned groups
├─> View group resources
└─> Cannot modify group membership
Member (Basic Access)
│
├─> Create own workspaces
├─> View own group information
└─> Manage personal resources
Purpose: Full platform administration and management
Granted To:
- IT administrators
- DevOps engineers
- Platform operators
- System administrators
Access Level: FULL (unrestricted)
Key Capabilities:
- All user management operations
- Create, modify, and delete groups
- Access all workspaces across the platform
- View and manage all resources
- Configure system settings
- Access audit logs
- View platform-wide statistics
Purpose: Manage workspaces and resources within specific groups
Granted To:
- Team leads
- Project managers
- Senior developers managing team resources
- Department coordinators
Access Level: GROUP-SCOPED (limited to assigned groups)
Key Capabilities:
- Manage all workspaces in their group(s)
- View all group members
- Monitor group resource usage
- Start/stop/delete any workspace in group
- View workspace logs and metrics
Limitations:
- Cannot add/remove group members
- Cannot modify group quotas
- Cannot create new groups
- Cannot access other groups
- Cannot promote users to admin
Purpose: Standard user access for development work
Granted To:
- Developers
- Analysts
- Contractors
- General users
Access Level: SELF-SCOPED (own resources only)
Key Capabilities:
- Create workspaces in assigned groups
- Manage own workspaces
- View group information
- Access group resources (within quota)
- Update personal profile
Limitations:
- Can only manage own workspaces
- Cannot delete others' workspaces
- Cannot modify group settings
- Cannot view others' workspace details
- Cannot add users to groups
| Action | Member | Group Admin | Platform Admin |
|---|---|---|---|
| View own profile | ✅ | ✅ | ✅ |
| Edit own profile | ✅ | ✅ | ✅ |
| View other users' profiles | ❌ | ✅ | |
| Create users | ❌ | ❌ | ✅ |
| Delete users | ❌ | ❌ | ✅ |
| Enable/disable users | ❌ | ❌ | ✅ |
| Reset passwords | ❌ | ❌ | ✅ |
| Promote to admin | ❌ | ❌ | ✅ |
| Manage group membership | ❌ | ❌ | ✅ |
| Action | Member | Group Admin | Platform Admin |
|---|---|---|---|
| View own groups | ✅ | ✅ | ✅ |
| View group members | ✅ | ✅ | ✅ |
| View group resources | ✅ | ✅ | ✅ |
| View all groups | ❌ | ❌ | ✅ |
| Create groups | ❌ | ❌ | ✅ |
| Delete groups | ❌ | ❌ | ✅ |
| Modify group quotas | ❌ | ❌ | ✅ |
| Add group members | ❌ | ❌ | ✅ |
| Remove group members | ❌ | ❌ | ✅ |
| Set group admin roles | ❌ | ❌ | ✅ |
| Action | Member | Group Admin | Platform Admin |
|---|---|---|---|
| Create workspace | ✅ | ✅ | ✅ |
| View own workspaces | ✅ | ✅ | ✅ |
| View group workspaces | ❌ | ✅ | |
| View all workspaces | ❌ | ❌ | ✅ |
| Start/stop own workspace | ✅ | ✅ | ✅ |
| Start/stop group workspace | ❌ | ✅ | |
| Delete own workspace | ✅ | ✅ | ✅ |
| Delete group workspace | ❌ | ✅ | |
| Delete any workspace | ❌ | ❌ | ✅ |
| View workspace logs | ✅ | ||
| View workspace metrics | ✅ | ||
| Update workspace details | ✅ |
| Action | Member | Group Admin | Platform Admin |
|---|---|---|---|
| View dashboard | ✅ | ✅ | ✅ |
| View platform stats | ❌ | ❌ | ✅ |
| Access admin panel | ❌ | ❌ | ✅ |
| View audit logs | ❌ | ❌ | ✅ |
| Modify system settings | ❌ | ❌ | ✅ |
| View cluster capacity | ❌ | ❌ | ✅ |
| Manage pricing config | ❌ | ❌ | ✅ |
Legend:
- ✅ Full access
- ❌ No access
⚠️ Limited/scoped access
Group Admin Access:
A Group Admin can perform actions on a workspace IF:
(user.isAdmin == true) OR
(workspace.groupId IN user.groupMemberships WHERE role == "admin")
Example:
-
User is Group Admin for
grp_engineering -
Workspace belongs to
grp_engineering -
Result: ✅ Can manage the workspace
-
User is Group Admin for
grp_engineering -
Workspace belongs to
grp_marketing -
Result: ❌ Cannot access the workspace
Member Access:
A Member can perform actions on a workspace IF:
(workspace.userId == user.id) OR
(user.isAdmin == true) OR
(isGroupAdmin(user, workspace.groupId))
Example:
-
User created the workspace
-
Result: ✅ Can manage the workspace
-
User didn't create the workspace
-
User is not admin
-
Result: ❌ Cannot manage the workspace
Workspace Creation:
User can create workspace in group IF:
(groupId IN user.groups) OR
(groupId IN user.groupMemberships.map(m => m.groupId)) OR
(user.isAdmin == true)
Example:
-
User belongs to
grp_engineering -
Trying to create workspace in
grp_engineering -
Result: ✅ Allowed
-
User doesn't belong to
grp_marketing -
Trying to create workspace in
grp_marketing -
Result: ❌ Denied
Appropriate Use Cases:
- Full-time IT administrators
- DevOps team members
- Platform operations staff
- System administrators
Approval Required:
- Manager approval
- Security team review
- Documented justification
- Regular access review
Security Considerations:
- Minimize number of platform admins (recommended: 2-4)
- Require MFA for all admins
- Regular audit of admin actions
- Document all admin accounts
Not Appropriate For:
- Temporary access needs → Use Group Admin
- Single-group management → Use Group Admin
- Development work → Use Member
- External contractors → Use Member
Appropriate Use Cases:
- Team leads managing team workspaces
- Project managers overseeing projects
- Department coordinators
- Senior engineers managing junior developers
Approval Required:
- Team manager approval
- Documented need
- Limited to specific groups
Security Considerations:
- Grant per-group, not platform-wide
- Review group admin assignments quarterly
- Revoke when responsibility changes
- Document reason for assignment
Not Appropriate For:
- Users who only need own workspaces → Use Member
- Across-group management → Use Platform Admin
- Temporary projects → Use Member
Appropriate Use Cases:
- Standard developers
- Analysts
- Contractors
- Temporary users
- External collaborators
Default Role:
- All new users start as Members
- Escalate only when needed
- Most users should remain Members
Process:
- User submits formal request
- Justification documented
- Manager approves
- Security team reviews
- Platform admin grants access
- Action logged in audit log
Required Documentation:
- Business justification
- Job responsibilities
- Duration of need
- Alternative approaches considered
Process:
- User requests access to specific group
- Group owner/manager approves
- Platform admin grants group admin role
- User notified of new permissions
Required Documentation:
- Which group(s) need access
- Why group admin role needed
- Expected duration
Automatic Triggers:
- User changes roles
- User leaves organization
- Project completion
- End of defined access period
Manual Review:
- Quarterly access reviews
- Annual certification
- Incident investigation
- Policy violations
Account Security:
- Enable MFA
- Use strong, unique passwords
- Rotate credentials quarterly
- Never share credentials
- Use dedicated admin accounts (not personal)
Operational Security:
- Review audit logs weekly
- Investigate anomalies immediately
- Document all admin actions
- Follow change management procedures
- Test in dev/staging first
Access Management:
- Regular review of user access
- Quarterly audit of admin accounts
- Document all privilege grants
- Revoke access promptly
- Follow least privilege principle
Responsible Management:
- Only manage workspaces when needed
- Communicate with workspace owners
- Document major changes
- Don't abuse access
- Report security concerns
Resource Management:
- Monitor group resources
- Communicate with team about limits
- Clean up unused workspaces with owner consent
- Plan capacity needs
Account Hygiene:
- Use strong passwords
- Don't share credentials
- Log out when done
- Report suspicious activity
- Follow security policies
Workspace Security:
- Don't commit secrets
- Use appropriate access controls
- Secure workspace passwords
- Delete when no longer needed
Logged Actions:
- User creation/deletion
- Role changes
- Group membership changes
- Admin privilege grants
- Workspace deletions
- System setting changes
Audit Log Contents:
{
"id": "audit_abc123",
"userId": "usr_admin1",
"username": "admin@example.com",
"action": "promote_user_to_admin",
"resource": "user:usr_target",
"details": {
"promotedUser": "developer@example.com",
"reason": "DevOps team member"
},
"timestamp": "2024-12-03T10:00:00Z",
"success": true
}Retention:
- Logs retained for 90 days (minimum)
- Compliance may require longer
- Export for long-term storage
- Regular backup of audit data
Quarterly Reviews:
- List all Platform Admins
- Verify business need
- Confirm manager approval
- Update documentation
Annual Certification:
- All elevated privileges reviewed
- Managers certify access
- Revoke unnecessary access
- Document review results
SOC 2 / ISO 27001:
- Documented access control policy
- Regular access reviews
- Audit logging enabled
- Least privilege enforced
GDPR:
- Document who has access to user data
- Justify admin access
- Track data access in logs
- Support data deletion requests
Debug Steps:
- Check user's role:
GET /api/admin/users/{userId} - Verify group membership:
- Check
groupsarray - Check
groupMembershipsarray
- Check
- Confirm group admin role:
- Check role in
groupMemberships
- Check role in
- Verify resource ownership:
- Check workspace
userId
- Check workspace
Common Issues:
- User in group but wrong role
- Workspace in different group
- User removed from group
- Admin privileges revoked
Check:
- Is user member of workspace's group?
- Does user own the workspace?
- Is user group admin for that group?
- Is user platform admin?
Resolution:
- Add user to group if appropriate
- Grant group admin role if needed
- Escalate to platform admin if required
Verify:
- User has platform admin status (
isAdmin: true) - Token is valid and not expired
- User is not trying to demote self
- Target resources exist
Before:
- Role: Member
- Groups:
grp_engineering(member) - Can: Manage own workspaces
Change:
# Promote to group admin
POST /api/admin/users/{userId}/groups/grp_engineering/promoteAfter:
- Role: Member + Group Admin
- Groups:
grp_engineering(admin) - Can: Manage all workspaces in engineering group
Before:
- Role: Member
- Groups:
grp_it(member) - Can: Manage own workspaces
Change:
# Promote to platform admin
POST /api/admin/users/{userId}/promoteAfter:
- Role: Platform Admin
- Groups:
grp_it(member) - Can: Full platform access
Before:
- Role: Member
- Groups:
grp_project_a(member),grp_project_b(member) - Can: Manage own workspaces
Change:
# Remove from groups
DELETE /api/admin/users/{userId}/groups/grp_project_a
DELETE /api/admin/users/{userId}/groups/grp_project_b
# Disable account
POST /api/admin/users/{userId}/disableAfter:
- Role: Member (disabled)
- Groups: (none)
- Can: Nothing (account disabled)
- User Account Management - Managing user accounts
- Group Management - Creating and managing groups
- Workspace Administration - Admin workspace operations