fix: New users get VIEWER role instead of MANAGER after registration
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
New accounts should have minimal permissions (VIEWER = view company dashboard only). Admins, office managers, or company managers promote users to higher roles manually. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6df36f97e8
commit
30d9cdb698
@ -157,6 +157,7 @@ def register():
|
||||
name=name,
|
||||
company_nip=company_nip,
|
||||
company_id=company_id,
|
||||
company_role='VIEWER',
|
||||
is_norda_member=is_norda_member,
|
||||
created_at=datetime.now(),
|
||||
is_active=True,
|
||||
@ -170,7 +171,7 @@ def register():
|
||||
|
||||
# Create user_companies record if company matched
|
||||
if company_id:
|
||||
uc = UserCompany(user_id=user.id, company_id=company_id, role='MANAGER', is_primary=True)
|
||||
uc = UserCompany(user_id=user.id, company_id=company_id, role='VIEWER', is_primary=True)
|
||||
db.add(uc)
|
||||
|
||||
db.commit()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user