feat: Implement permission gate for appointment and billing controllers

- Added PermissionGateTrait to manage access control for AppointmentPlanController and BillingController.
- Introduced denyUnlessGrantedForPlanning method in AppointmentPlanController to handle specific permission checks for planning appointments.
- Updated existing methods in both controllers to utilize the new permission checks.
- Refactored ResourcePermissionTrait to use PermissionGateTrait for cleaner permission management.
- Added tests to ensure proper permission enforcement across different scenarios, including cross-tenant access restrictions for staff.
This commit is contained in:
hamed
2026-08-08 10:27:13 +03:30
parent c452150a83
commit 934405c42d
14 changed files with 830 additions and 67 deletions
+9 -1
View File
@@ -8,7 +8,15 @@
List all active doctor services.
**Permission:** `PUBLIC`
**Permission:** `AUTH` — بدون مجوزِ رجیستری، و این عمدی است.
> سند تا ۲۰۲۶-۰۸-۰۸ اینجا `PUBLIC` نوشته بود که با رفتار نمی‌خواند: مسیر پشت firewall
> است و درخواستِ بدون توکن `401` می‌گیرد.
>
> کاتالوگ سراسری است — `findActive()` بدون هیچ فیلترِ محیط. هم‌ردهٔ `specialties` و
> `tags`. آدیت ۲۰۲۶-۰۸-۰۷ آن را گَپِ `services.view` دانسته بود؛ در ۲۰۲۶-۰۸-۰۸ مثبت
> کاذب تشخیص داده شد: این فهرست dropdown فرم‌ها را پر می‌کند، پس گِیت‌زدنش یک مجوز را
> با نبودِ مجوزِ دیگری می‌شکند. در `ApiLeastPrivilegeTest::ALLOWED_200` ثبت است.
### Query Parameters
| Param | Type | Required | Description |