Skip to content

Commit

Permalink
Fix delete view permissions check
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronPlave committed Dec 11, 2023
1 parent 0d88e14 commit c264172
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utilities/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2203,8 +2203,8 @@ const effects = {
async deleteViews(views: ViewSlim[], user: User | null): Promise<boolean> {
try {
const hasPermission = views.reduce((previousValue, view) => {
return previousValue || queryPermissions.DELETE_VIEWS(user, view);
}, false);
return previousValue && queryPermissions.DELETE_VIEWS(user, view);
}, true);
if (!hasPermission) {
throwPermissionError('delete one or all of these views');
}
Expand Down

0 comments on commit c264172

Please sign in to comment.