mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
e15c4ef1fe
@ -279,23 +279,11 @@ describe('list action with acl', () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
app.resourcer.use(
|
// @ts-ignore
|
||||||
(ctx, next) => {
|
const response = await (await app.agent().login(users[0].id, 'user'))
|
||||||
ctx.state.currentRole = 'user';
|
.set('X-With-ACL-Meta', true)
|
||||||
ctx.state.currentUser = {
|
.resource('posts')
|
||||||
id: 1,
|
.list();
|
||||||
tag: 'c',
|
|
||||||
};
|
|
||||||
|
|
||||||
return next();
|
|
||||||
},
|
|
||||||
{
|
|
||||||
before: 'acl',
|
|
||||||
after: 'auth',
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const response = await (app as any).agent().set('X-With-ACL-Meta', true).resource('posts').list();
|
|
||||||
const data = response.body;
|
const data = response.body;
|
||||||
expect(data.meta.allowedActions.view).toEqual([1, 2, 3]);
|
expect(data.meta.allowedActions.view).toEqual([1, 2, 3]);
|
||||||
expect(data.meta.allowedActions.update).toEqual([2, 3]);
|
expect(data.meta.allowedActions.update).toEqual([2, 3]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user