This commit is contained in:
2020-07-31 21:54:06 +00:00
parent ecc931dfc0
commit b5278f511c
5 changed files with 45 additions and 25 deletions

View File

@@ -21,9 +21,21 @@
export default {
async created() {
await window.$gz.enums.fetchEnumList("AuthorizationRoles");
this.availableRoles = window.$gz.enums.getSelectionList(
"AuthorizationRoles"
);
let rawRoles = window.$gz.enums.getSelectionList("AuthorizationRoles");
if (this.limitSelectionTo == null) {
this.availableRoles = rawRoles;
} else {
if (this.limitSelectionTo == "inside") {
//CustomerLimited=2048, CustomerFull=4096
this.availableRoles = rawRoles.filter(
z => z.id != 2048 && z.id != 4096
);
} else {
this.availableRoles = rawRoles.filter(
z => z.id == 2048 || z.id == 4096
);
}
}
},
data() {
return {
@@ -42,6 +54,7 @@ export default {
type: String,
required: false
},
limitSelectionTo: { type: String, default: null }, //"inside" - no customer roles, "outside" - no non-customer roles
testId: String
},
computed: {