Merge pull request #725 from directus/permissions-404

permissions 404
This commit is contained in:
Rijk van Zanten
2020-10-19 15:33:40 -04:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import { AuthorizationService } from './authorization';
import { pick, clone, cloneDeep } from 'lodash';
import getDefaultValue from '../utils/get-default-value';
import { InvalidPayloadException } from '../exceptions';
import { ForbiddenException } from '../exceptions';
export class ItemsService implements AbstractService {
collection: string;
@@ -256,6 +257,9 @@ export class ItemsService implements AbstractService {
}
const result = await runAST(ast, { knex: this.knex });
if (result === null) throw new ForbiddenException();
return result;
}

View File

@@ -142,6 +142,10 @@ export default defineComponent({
permission.value = response.data.data;
} catch (err) {
error.value = err;
if (err?.response?.status === 403) {
router.push(`/settings/roles/${props.roleKey || 'public'}`);
}
} finally {
loading.value = false;
}