Update team and collection authorization
This commit is contained in:
@ -7,7 +7,6 @@ import { User, ApiKey } from '../../models';
|
||||
|
||||
type AuthOptions = {
|
||||
require?: boolean,
|
||||
adminOnly?: boolean,
|
||||
};
|
||||
|
||||
export default function auth(options: AuthOptions = {}) {
|
||||
@ -96,10 +95,6 @@ export default function auth(options: AuthOptions = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.adminOnly && !user.isAdmin) {
|
||||
throw httpErrors.Forbidden('Only available for admins');
|
||||
}
|
||||
|
||||
ctx.state.token = token;
|
||||
ctx.state.user = user;
|
||||
// $FlowFixMe
|
||||
|
Reference in New Issue
Block a user