mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52: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: {
|
||||
name: 'testRole',
|
||||
strategy: { actions: ['view'] },
|
||||
snippets: ['pm', 'pm.*'],
|
||||
snippets: ['pm.acl.roles'],
|
||||
},
|
||||
});
|
||||
|
||||
@ -78,4 +78,22 @@ describe('snippet', () => {
|
||||
|
||||
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.users:*',
|
||||
'dataSources.roles:*',
|
||||
'roles.dataSourcesCollections:*',
|
||||
'roles.dataSourceResources:*',
|
||||
],
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user