mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Disabled mirage member routes permission checks
refs 258f56ded9
- `@ember/test-helpers` is not included outside of test builds but we load mirage in development too so this was causing import errors that completely broke the app in development
- commented out the checks for now to get development working again whilst we look for alternatives to `getContext()`
This commit is contained in:
parent
04621b1e2e
commit
568e4183e3
1 changed files with 13 additions and 11 deletions
|
@ -3,21 +3,23 @@ import moment from 'moment-timezone';
|
||||||
import nql from '@tryghost/nql';
|
import nql from '@tryghost/nql';
|
||||||
import {Response} from 'miragejs';
|
import {Response} from 'miragejs';
|
||||||
import {extractFilterParam, paginateModelCollection} from '../utils';
|
import {extractFilterParam, paginateModelCollection} from '../utils';
|
||||||
import {getContext} from '@ember/test-helpers';
|
// import {getContext} from '@ember/test-helpers';
|
||||||
import {underscore} from '@ember/string';
|
import {underscore} from '@ember/string';
|
||||||
|
|
||||||
function hasInvalidPermissions() {
|
function hasInvalidPermissions() {
|
||||||
const {owner} = getContext();
|
return false;
|
||||||
const session = owner.lookup('service:session');
|
|
||||||
|
|
||||||
if (!session?.user?.isAdmin) {
|
// const {owner} = getContext(this);
|
||||||
return new Response(403, {}, {
|
// const session = owner.lookup('service:session');
|
||||||
errors: [{
|
|
||||||
type: 'NoPermissionError',
|
// if (!session?.user?.isAdmin) {
|
||||||
message: 'You do not have permission to perform this action'
|
// return new Response(403, {}, {
|
||||||
}]
|
// errors: [{
|
||||||
});
|
// type: 'NoPermissionError',
|
||||||
}
|
// message: 'You do not have permission to perform this action'
|
||||||
|
// }]
|
||||||
|
// });
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function withPermissionsCheck(fn) {
|
function withPermissionsCheck(fn) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue