mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
fix(plugin-acl): pm.acl.roles snippet (#4026)
This commit is contained in:
parent
d4b4391aba
commit
2a31de8ce6
@ -60,7 +60,7 @@ describe('snippet', () => {
|
|||||||
values: {
|
values: {
|
||||||
name: 'testRole',
|
name: 'testRole',
|
||||||
strategy: { actions: ['view'] },
|
strategy: { actions: ['view'] },
|
||||||
snippets: ['pm', 'pm.*'],
|
snippets: ['pm.acl.roles'],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -78,4 +78,22 @@ describe('snippet', () => {
|
|||||||
|
|
||||||
expect(getResp.statusCode).toEqual(200);
|
expect(getResp.statusCode).toEqual(200);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should allow to get roles dataSourceCollections', async () => {
|
||||||
|
await app.db.getRepository('roles').create({
|
||||||
|
values: {
|
||||||
|
name: 'testRole',
|
||||||
|
strategy: {},
|
||||||
|
snippets: ['pm.acl.roles'],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const canRes = app.acl.can({
|
||||||
|
role: 'testRole',
|
||||||
|
action: 'list',
|
||||||
|
resource: 'roles.dataSourcesCollections',
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(canRes).toBeTruthy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -181,6 +181,8 @@ export class PluginACLServer extends Plugin {
|
|||||||
'roles.menuUiSchemas:*',
|
'roles.menuUiSchemas:*',
|
||||||
'roles.users:*',
|
'roles.users:*',
|
||||||
'dataSources.roles:*',
|
'dataSources.roles:*',
|
||||||
|
'roles.dataSourcesCollections:*',
|
||||||
|
'roles.dataSourceResources:*',
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user