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 {Response} from 'miragejs';
|
||||
import {extractFilterParam, paginateModelCollection} from '../utils';
|
||||
import {getContext} from '@ember/test-helpers';
|
||||
// import {getContext} from '@ember/test-helpers';
|
||||
import {underscore} from '@ember/string';
|
||||
|
||||
function hasInvalidPermissions() {
|
||||
const {owner} = getContext();
|
||||
const session = owner.lookup('service:session');
|
||||
return false;
|
||||
|
||||
if (!session?.user?.isAdmin) {
|
||||
return new Response(403, {}, {
|
||||
errors: [{
|
||||
type: 'NoPermissionError',
|
||||
message: 'You do not have permission to perform this action'
|
||||
}]
|
||||
});
|
||||
}
|
||||
// const {owner} = getContext(this);
|
||||
// const session = owner.lookup('service:session');
|
||||
|
||||
// if (!session?.user?.isAdmin) {
|
||||
// return new Response(403, {}, {
|
||||
// errors: [{
|
||||
// type: 'NoPermissionError',
|
||||
// message: 'You do not have permission to perform this action'
|
||||
// }]
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
function withPermissionsCheck(fn) {
|
||||
|
|
Loading…
Add table
Reference in a new issue