This commit is contained in:
2021-07-14 23:55:43 +00:00
parent baeaa99351
commit 019e6fcf01
10 changed files with 120 additions and 26 deletions

View File

@@ -457,7 +457,9 @@ Subcontractor / tech limited modifications
TODO: Outside Service repair COST is still showing for restricted and other users
should it?
todo: units on work order are not limited to customer on work order??
todo: looks like wont' need subrights system, need to disentangle and remove it from workorder
todo: Status on work order doesn't seem to be preventing "Who can select" by role properly

View File

@@ -953,10 +953,18 @@ export default {
return this.pvm.rights.change && this.pvm.subRights.labors.create;
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.pvm.rights.change &&
this.pvm.subRights.labors.delete
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.labors.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.labors.delete &&
!this.value.userIsRestrictedType
);
}
//----
}

View File

@@ -821,13 +821,25 @@ export default {
return this.activeItemIndex != null;
},
canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.loans.create;
return (
this.pvm.rights.change &&
this.pvm.subRights.loans.create &&
!this.value.userIsRestrictedType
);
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.loans.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.loans.delete &&
!this.value.userIsRestrictedType
);
}
//----

View File

@@ -1080,15 +1080,23 @@ export default {
},
canAdd: function() {
return (
this.pvm.rights.change && this.pvm.subRights.outsideServices.create
this.pvm.rights.change &&
this.pvm.subRights.outsideServices.create &&
!this.value.userIsRestrictedType
);
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return (
this.pvm.rights.change && this.pvm.subRights.outsideServices.delete
this.pvm.rights.change &&
this.pvm.subRights.outsideServices.delete &&
!this.value.userIsRestrictedType
);
}

View File

@@ -373,13 +373,21 @@ export default {
return this.activeItemIndex != null;
},
// canAdd: function() {
// return this.pvm.rights.change && this.pvm.subRights.partRequests.create;
// return this.pvm.rights.change && this.pvm.subRights.partRequests.create && !this.value.userIsRestrictedType;
// },
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.partRequests.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.partRequests.delete &&
!this.value.userIsRestrictedType
);
}
//----

View File

@@ -1071,13 +1071,25 @@ export default {
return this.activeItemIndex != null;
},
canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.parts.create;
return (
this.pvm.rights.change &&
this.pvm.subRights.parts.create &&
!this.value.userIsRestrictedType
);
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.parts.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.parts.delete &&
!this.value.userIsRestrictedType
);
}
//----

View File

@@ -664,13 +664,25 @@ export default {
return this.activeItemIndex != null;
},
canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.scheduledUsers.create;
return (
this.pvm.rights.change &&
this.pvm.subRights.scheduledUsers.create &&
!this.value.userIsRestrictedType
);
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.scheduledUsers.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.scheduledUsers.delete &&
!this.value.userIsRestrictedType
);
}
}
};

View File

@@ -625,13 +625,25 @@ export default {
return this.activeItemIndex != null;
},
canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.tasks.create;
return (
this.pvm.rights.change &&
this.pvm.subRights.tasks.create &&
!this.value.userIsRestrictedType
);
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.tasks.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.tasks.delete &&
!this.value.userIsRestrictedType
);
}
}
};

View File

@@ -931,10 +931,18 @@ export default {
return this.pvm.rights.change && this.pvm.subRights.travels.create;
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.pvm.rights.change &&
this.pvm.subRights.travels.delete
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.travels.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.travels.delete &&
!this.value.userIsRestrictedType
);
}
//----

View File

@@ -758,13 +758,25 @@ export default {
return this.activeItemIndex != null;
},
canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.units.create;
return (
this.pvm.rights.change &&
this.pvm.subRights.units.create &&
!this.value.userIsRestrictedType
);
},
canDelete: function() {
return this.activeItemIndex != null && this.canDeleteAll;
return (
this.activeItemIndex != null &&
this.canDeleteAll &&
!this.value.userIsRestrictedType
);
},
canDeleteAll: function() {
return this.pvm.rights.change && this.pvm.subRights.units.delete;
return (
this.pvm.rights.change &&
this.pvm.subRights.units.delete &&
!this.value.userIsRestrictedType
);
}
}
};