feat(auth): add user and role management
This commit is contained in:
10
packages/backend/src/graphql/queries/get-roles.ee.ts
Normal file
10
packages/backend/src/graphql/queries/get-roles.ee.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import Context from '../../types/express/context';
|
||||
import Role from '../../models/role';
|
||||
|
||||
const getRoles = async (_parent: unknown, params: unknown, context: Context) => {
|
||||
context.currentUser.can('read', 'Role');
|
||||
|
||||
return await Role.query().orderBy('name');
|
||||
};
|
||||
|
||||
export default getRoles;
|
Reference in New Issue
Block a user