feat: add caching prevention headers to getUserPermissions method
This commit is contained in:
parent
2a69b83d84
commit
2d1557d5ec
@ -36,6 +36,11 @@ class PermissionController {
|
||||
}
|
||||
|
||||
static async getUserPermissions(req, res) {
|
||||
// Prevent caching of permission responses
|
||||
res.set('Cache-Control', 'no-store, no-cache, must-revalidate, private');
|
||||
res.set('Pragma', 'no-cache');
|
||||
res.set('Vary', 'Authorization');
|
||||
|
||||
// Access control: only self or admin/super_admin can view
|
||||
const requestedUserId = Number(req.params.id);
|
||||
const requesterUserId = Number(req.user.userId ?? req.user.id ?? req.user.sub);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user