refactor: Policies Architecture (#1016)
* add policy serialize method * Add policies to collection responses * wip * test: remove .only * refactor: Return policies with team and document requests * store policies on the client * refactor: drive admin UI from policies
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import Router from 'koa-router';
|
||||
import auth from '../middlewares/authentication';
|
||||
import { presentUser, presentTeam } from '../presenters';
|
||||
import { presentUser, presentTeam, presentPolicies } from '../presenters';
|
||||
import { Team } from '../models';
|
||||
|
||||
const router = new Router();
|
||||
@ -15,6 +15,7 @@ router.post('auth.info', auth(), async ctx => {
|
||||
user: presentUser(user, { includeDetails: true }),
|
||||
team: presentTeam(team),
|
||||
},
|
||||
policies: presentPolicies(user, [team]),
|
||||
};
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user