requested changes
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
1ce5d781c5
commit
a7ec8d6e69
|
@ -17,13 +17,13 @@ describe('Directive acl', () => {
|
|||
});
|
||||
$httpBackend.whenPOST('Accounts/user/acl').respond([
|
||||
{
|
||||
'id': 1,
|
||||
'model': 'ModelExample',
|
||||
'property': '*',
|
||||
'accessType': '*',
|
||||
'permission': 'ALLOW',
|
||||
'principalType': 'ROLE',
|
||||
'principalId': 'employee'
|
||||
id: 1,
|
||||
model: 'ModelExample',
|
||||
property: '*',
|
||||
accessType: '*',
|
||||
permission: 'ALLOW',
|
||||
principalType: 'ROLE',
|
||||
principalId: 'employee'
|
||||
}
|
||||
]);
|
||||
aclService.load();
|
||||
|
|
|
@ -11,14 +11,17 @@ function vnUserAcl(aclService) {
|
|||
acls = $attrs.vnUserAcl.split(',').map(i => i.trim());
|
||||
if (acls[0] == '') return;
|
||||
|
||||
let action = $attrs.vnAclAction || 'disable';
|
||||
const action = $attrs.vnAclAction || 'disable';
|
||||
|
||||
// The acls always come formatted as "Model.property/accessType"
|
||||
// Example: "Client.create/w"
|
||||
|
||||
let model = acls[0].split('.')[0];
|
||||
let property = acls[0].split('.')[1].split('/')[0];
|
||||
let accessType = acls[0].split('.')[1].split('/')[1];
|
||||
const splitAcl = acls[0].split('.');
|
||||
const splitSlash = splitAcl[1].split('/');
|
||||
|
||||
const model = splitAcl[0];
|
||||
const property = splitSlash[0];
|
||||
let accessType = splitSlash[1];
|
||||
|
||||
// There can be 3 cases for the acessType: Write(w), Read(r) or All(*)
|
||||
|
||||
|
@ -30,11 +33,11 @@ function vnUserAcl(aclService) {
|
|||
if (hasAny) return;
|
||||
|
||||
if (action === 'disable') {
|
||||
let element = $element[0];
|
||||
let elementToDisable = element.$ctrl;
|
||||
const element = $element[0];
|
||||
const elementToDisable = element.$ctrl;
|
||||
|
||||
if (!(elementToDisable instanceof FormInput)) {
|
||||
let selector = 'input, textarea, button, submit';
|
||||
const selector = 'input, textarea, button, submit';
|
||||
|
||||
if (!element.matches(selector))
|
||||
element = element.querySelector(selector);
|
||||
|
|
Loading…
Reference in New Issue