mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat: new permission to allow users to see other users requests
closes #840
This commit is contained in:
@@ -57,7 +57,8 @@ requestRoutes.get('/', async (req, res, next) => {
|
||||
}
|
||||
|
||||
const [requests, requestCount] = req.user?.hasPermission(
|
||||
Permission.MANAGE_REQUESTS
|
||||
[Permission.MANAGE_REQUESTS, Permission.REQUEST_VIEW],
|
||||
{ type: 'or' }
|
||||
)
|
||||
? await requestRepository.findAndCount({
|
||||
order: sortFilter,
|
||||
@@ -102,10 +103,10 @@ requestRoutes.post(
|
||||
|
||||
if (
|
||||
req.body.userId &&
|
||||
!(
|
||||
req.user?.hasPermission(Permission.MANAGE_USERS) &&
|
||||
req.user?.hasPermission(Permission.MANAGE_REQUESTS)
|
||||
)
|
||||
!req.user?.hasPermission([
|
||||
Permission.MANAGE_USERS,
|
||||
Permission.MANAGE_REQUESTS,
|
||||
])
|
||||
) {
|
||||
return next({
|
||||
status: 403,
|
||||
|
Reference in New Issue
Block a user