fix: Allow users with report_manage permission to access CSAT reports (#11625)

- Extended CsatSurveyResponsePolicy to support report_manage permission
- Added enterprise extension module following existing pattern
- Users with report_manage custom role can now access CSAT index,
metrics, and download
- Added comprehensive tests for both base and enterprise policy behavior
This commit is contained in:
Sojan Jose
2025-05-29 12:09:03 -06:00
committed by GitHub
parent b1898e019b
commit 3548948c92
4 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
module Enterprise::CsatSurveyResponsePolicy
def index?
@account_user.custom_role&.permissions&.include?('report_manage') || super
end
def metrics?
@account_user.custom_role&.permissions&.include?('report_manage') || super
end
def download?
@account_user.custom_role&.permissions&.include?('report_manage') || super
end
end