Skip to main content

Role-Based Access Control

FieldValue
Document IDASCEND-SEC-013
Version1.0.0
Last UpdatedDecember 19, 2025
AuthorAscend Engineering Team
PublisherOW-KAI Technologies Inc.
ClassificationEnterprise Client Documentation
ComplianceSOC 2 CC6.1/CC6.2, PCI-DSS 7.1/8.3, HIPAA 164.312, NIST 800-53 AC-2/SI-4

Reading Time: 8 minutes | Skill Level: Intermediate

Overview

ASCEND implements hierarchical role-based access control (RBAC) with granular permissions. Roles determine access levels, approval authority, and feature availability.

Role Hierarchy

+---------------------------------------------------------------------------------+
| ROLE HIERARCHY |
+---------------------------------------------------------------------------------+
| |
| Level 5: SUPER_ADMIN |
| +-------------------------------------------------------------------------+ |
| | - Full platform access | |
| | - Organization management | |
| | - User provisioning | |
| | - System configuration | |
| +-------------------------------------------------------------------------+ |
| | |
| v |
| Level 4: ADMIN |
| +-------------------------------------------------------------------------+ |
| | - Agent management | |
| | - Policy configuration | |
| | - User management (within org) | |
| | - Approve critical actions | |
| +-------------------------------------------------------------------------+ |
| | |
| v |
| Level 3: MANAGER |
| +-------------------------------------------------------------------------+ |
| | - Team oversight | |
| | - Approve high-risk actions | |
| | - View audit logs | |
| | - Configure smart rules | |
| +-------------------------------------------------------------------------+ |
| | |
| v |
| Level 2: ANALYST |
| +-------------------------------------------------------------------------+ |
| | - View analytics | |
| | - Approve medium-risk actions | |
| | - Create reports | |
| +-------------------------------------------------------------------------+ |
| | |
| v |
| Level 1: VIEWER |
| +-------------------------------------------------------------------------+ |
| | - Read-only access | |
| | - View dashboards | |
| | - View action history | |
| +-------------------------------------------------------------------------+ |
| |
+---------------------------------------------------------------------------------+

Role Definitions

RoleLevelApproval AuthorityKey Permissions
super_admin5All actionsFull platform access
admin4Critical (80+)Agent/policy management
manager3High (60-80)Team oversight, rules
analyst2Medium (30-60)Analytics, reports
viewer1NoneRead-only access

Permission Categories

Agent Permissions

PermissionDescriptionRoles
agent:readView agentsAll
agent:writeCreate/update agentsadmin, super_admin
agent:deleteDelete agentssuper_admin
agent:approveApprove agent registrationadmin, super_admin

Action Permissions

PermissionDescriptionRoles
action:readView actionsAll
action:submitSubmit actionsanalyst+, SDK
action:approveApprove pending actionsBased on risk level
action:denyDeny pending actionsmanager+

Policy Permissions

PermissionDescriptionRoles
policy:readView policiesAll
policy:writeCreate/update policiesadmin, super_admin
policy:deleteDelete policiessuper_admin
policy:activateActivate policiesadmin, super_admin

Analytics Permissions

PermissionDescriptionRoles
analytics:readView analyticsanalyst+
analytics:exportExport datamanager+
analytics:executiveExecutive dashboardadmin+

Audit Permissions

PermissionDescriptionRoles
audit:readView audit logsanalyst+
audit:exportExport audit logsadmin+
audit:complianceCompliance reportsadmin+

Approval Authority Matrix

Risk-Based Approval

Risk LevelScore RangeRequired Role
Low0-30Auto-approve (no role needed)
Medium30-60analyst (level 2+)
High60-80manager (level 3+)
Critical80-100admin (level 4+)

Multi-Approval Requirements

# High-value actions may require multiple approvers
{
"conditions": {"amount_above": 100000},
"action_params": {
"approvers_required": 3,
"approver_roles": ["manager", "admin", "super_admin"]
}
}

API Key Permissions

Scoped API Keys

curl -X POST "https://pilot.owkai.app/api/keys/generate" \
-H "Authorization: Bearer <jwt_token>" \
-d '{
"name": "Read-Only Analytics Key",
"permissions": [
{"category": "action", "actions": ["read"]},
{"category": "analytics", "actions": ["read"]}
]
}'

Permission Validation

# API key permissions are checked on each request
def check_permission(api_key, required_permission):
for perm in api_key.permissions:
if perm.category == required_permission.category:
if required_permission.action in perm.actions:
return True
return False

SSO Group Mapping

Group-to-Role Mapping

# Source: sso_manager.py:64
GROUP_TO_ROLE_MAPPING = {
# Okta Groups
"OW-AI-Executives": 5, # super_admin
"OW-AI-Administrators": 4, # admin
"OW-AI-Managers": 3, # manager
"OW-AI-Analysts": 2, # analyst
"OW-AI-Users": 1, # viewer

# Azure AD Groups
"OW-AI Executive Team": 5,
"OW-AI System Administrators": 4,
"OW-AI Security Managers": 3
}

Automatic Role Assignment

def assign_role_from_groups(groups: List[str]) -> str:
"""Assign highest matching role from IdP groups."""
max_level = 0
for group in groups:
if group in GROUP_TO_ROLE_MAPPING:
level = GROUP_TO_ROLE_MAPPING[group]
max_level = max(max_level, level)

return LEVEL_TO_ROLE[max_level]

User Management

Create User with Role

curl -X POST "https://pilot.owkai.app/api/admin/users" \
-H "Authorization: Bearer <admin_jwt>" \
-d '{
"email": "analyst@company.com",
"role": "analyst",
"organization_id": 1
}'

Update User Role

curl -X PUT "https://pilot.owkai.app/api/admin/users/123" \
-H "Authorization: Bearer <admin_jwt>" \
-d '{
"role": "manager"
}'

Route Protection

Role-Based Route Guards

from dependencies import require_role

@router.post("/policies")
async def create_policy(
current_user: dict = Depends(require_role(["admin", "super_admin"]))
):
"""Only admins can create policies."""
pass

@router.get("/analytics/executive")
async def executive_dashboard(
current_user: dict = Depends(require_role(["admin", "super_admin"]))
):
"""Executive dashboard requires admin access."""
pass

Minimum Role Check

def require_minimum_role(minimum_level: int):
"""Require user to have at least specified role level."""
def check(current_user: dict):
user_level = ROLE_LEVELS.get(current_user.get("role"), 0)
if user_level < minimum_level:
raise HTTPException(
status_code=403,
detail="Insufficient permissions"
)
return current_user
return check

Compliance Mapping

StandardRequirementImplementation
SOC 2 CC6.1Logical access controlsRBAC policies
SOC 2 CC6.3Role-based accessHierarchical roles
PCI-DSS 7.1Need-to-know accessPermission scoping
NIST AC-2Account managementUser provisioning
NIST AC-3Access enforcementRoute guards

Best Practices

1. Principle of Least Privilege

# Assign minimum necessary role
{
"role": "analyst", # Not admin if analytics is all they need
"permissions": ["analytics:read"]
}

2. Regular Access Reviews

# Review and audit role assignments
for user in organization.users:
if user.last_active < ninety_days_ago:
flag_for_review(user)

3. Use API Key Scoping

# Limit API keys to necessary permissions
{
"permissions": ["action:submit", "action:read"]
# Don't include agent:delete for action-submission keys
}

4. Audit Role Changes

# Log all role modifications
{
"event_type": "ROLE_CHANGE",
"user_id": 123,
"old_role": "analyst",
"new_role": "manager",
"changed_by": "admin@company.com"
}

Next Steps


Document Version: 1.0.0 | Last Updated: December 2025