fix front test not working
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
baa7aa45b2
commit
2e4e0b12ab
|
@ -15,6 +15,17 @@ describe('Directive acl', () => {
|
|||
{role: {name: 'myOtherRole'}}
|
||||
]
|
||||
});
|
||||
$httpBackend.whenPOST('Accounts/user/acl').respond([
|
||||
{
|
||||
'id': 1,
|
||||
'model': 'ModelExample',
|
||||
'property': '*',
|
||||
'accessType': '*',
|
||||
'permission': 'ALLOW',
|
||||
'principalType': 'ROLE',
|
||||
'principalId': 'employee'
|
||||
}
|
||||
]);
|
||||
aclService.load();
|
||||
$httpBackend.flush();
|
||||
}));
|
||||
|
|
|
@ -11,6 +11,17 @@ describe('Service acl', () => {
|
|||
{role: {name: 'baz'}}
|
||||
]
|
||||
});
|
||||
$httpBackend.whenPOST('Accounts/user/acl').respond([
|
||||
{
|
||||
'id': 1,
|
||||
'model': 'ModelExample',
|
||||
'property': '*',
|
||||
'accessType': '*',
|
||||
'permission': 'ALLOW',
|
||||
'principalType': 'ROLE',
|
||||
'principalId': 'employee'
|
||||
}
|
||||
]);
|
||||
aclService = _aclService_;
|
||||
aclService.load();
|
||||
$httpBackend.flush();
|
||||
|
|
|
@ -16,8 +16,10 @@ class AclService {
|
|||
this.roles = {};
|
||||
this.rolesMap = {};
|
||||
res.data.roles.forEach(role => {
|
||||
if (role.role)
|
||||
if (role.role) {
|
||||
this.rolesMap[role.role.name] = true;
|
||||
this.roles[role.role.name] = true;
|
||||
}
|
||||
});
|
||||
|
||||
this.acls = {};
|
||||
|
|
Loading…
Reference in New Issue