mirror of
https://github.com/directus/directus.git
synced 2026-01-24 16:57:55 -05:00
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user