feat: restrict guest doctor access in clinic context by updating role-based routing and sidebar menu
This commit is contained in:
+1
-1
@@ -297,7 +297,7 @@ Authorization: Bearer <token>
|
||||
- context کلینیک که دکتر **صاحب** آن است: `"clinic"` (دسترسی کامل مالک)
|
||||
- context منشی: `"secretary"`
|
||||
|
||||
> **نکته frontend:** پس از `switchContext`، `primaryRole` در store باید از `context.role` آپدیت شود.
|
||||
> **نکته frontend:** پس از `switchContext`، `primaryRole` در store از `context.role` و `scope` از `context.scope` آپدیت میشود. وقتی `role:"doctor"` و `scope:"clinic"` است (پزشکِ مهمان)، Sidebar فقط «داشبورد» و «نوبتها» را نشان میدهد و مسیرهای مدیریتی (`staff`, `clinic-services`, `subscription`, `my-secretaries`, `my-patients`, `profile`) به داشبورد ریدایرکت میشوند. در سمت backend هم endpointهای مدیریتی برای پزشک فقط scope **شخصیِ** خودش را برمیگردانند (نه کلینیک) و endpointهای ویرایش کلینیک مالکیت را چک میکنند (۴۰۳).
|
||||
|
||||
**قانون `db_uuid`**:
|
||||
- اگر یک context وجود دارد: خودکار فعال میشود
|
||||
|
||||
Reference in New Issue
Block a user