This commit is contained in:
@@ -2,29 +2,30 @@
|
|||||||
import _ from "../libs/lodash.min.js";
|
import _ from "../libs/lodash.min.js";
|
||||||
import store from "../store";
|
import store from "../store";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
AYATYPE: {
|
// AYATYPE: {
|
||||||
NoType: 0,
|
// NoType: 0,
|
||||||
Global: 1,
|
// Global: 1,
|
||||||
Widget: 2,
|
// Widget: 2,
|
||||||
User: 3,
|
// User: 3,
|
||||||
ServerState: 4,
|
// ServerState: 4,
|
||||||
License: 5,
|
// License: 5,
|
||||||
LogFile: 6,
|
// LogFile: 6,
|
||||||
DEPRECATED_REUSELATER_7: 7,
|
// DEPRECATED_REUSELATER_7: 7,
|
||||||
DEPRECATED_REUSELATER_8: 8,
|
// DEPRECATED_REUSELATER_8: 8,
|
||||||
JobOperations: 9,
|
// JobOperations: 9,
|
||||||
AyaNova7Import: 10,
|
// AyaNova7Import: 10,
|
||||||
TrialSeeder: 11,
|
// TrialSeeder: 11,
|
||||||
Metrics: 12,
|
// Metrics: 12,
|
||||||
Locale: 13,
|
// Locale: 13,
|
||||||
UserOptions: 14,
|
// UserOptions: 14,
|
||||||
DEPRECATED_REUSELATER_15: 15,
|
// DEPRECATED_REUSELATER_15: 15,
|
||||||
DEPRECATED_REUSELATER_16: 16,
|
// DEPRECATED_REUSELATER_16: 16,
|
||||||
FileAttachment: 17,
|
// FileAttachment: 17,
|
||||||
DataFilter: 18,
|
// DataFilter: 18,
|
||||||
FormCustom: 19
|
// FormCustom: 19
|
||||||
},
|
// },
|
||||||
AUTHORIZATION_ROLES: {
|
AUTHORIZATION_ROLES: {
|
||||||
///<summary>No role set</summary>
|
///<summary>No role set</summary>
|
||||||
NoRole: 0,
|
NoRole: 0,
|
||||||
@@ -65,7 +66,7 @@ export default {
|
|||||||
}
|
}
|
||||||
return role === (store.state.roles & role);
|
return role === (store.state.roles & role);
|
||||||
},
|
},
|
||||||
rights(userRole, oType, oId) {
|
rights(vm, userRole, oType, oId) {
|
||||||
//NOTE: this is to mirror the functionality of BizRoles.cs where all rights by role are specified in server project
|
//NOTE: this is to mirror the functionality of BizRoles.cs where all rights by role are specified in server project
|
||||||
//any change there needs to be mirrored here
|
//any change there needs to be mirrored here
|
||||||
|
|
||||||
@@ -85,14 +86,19 @@ export default {
|
|||||||
delete: false
|
delete: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//ISSUE: I keep seeing imports as undefined other than underscore in here, no idea why
|
||||||
|
//Maybe I need to combine rights and types and roles into a single object that I can reach off the VM / MAIN
|
||||||
|
//TODO, put this somewhere else
|
||||||
var AYANOVA_RIGHTS = JSON.parse(
|
var AYANOVA_RIGHTS = JSON.parse(
|
||||||
'{"User":{"Change":2,"EditOwn":0,"ReadFullRecord":1},"UserOptions":{"Change":2,"EditOwn":0,"ReadFullRecord":1},"Widget":{"Change":34,"EditOwn":256,"ReadFullRecord":17},"ServerState":{"Change":16384,"EditOwn":0,"ReadFullRecord":32767},"License":{"Change":16386,"EditOwn":0,"ReadFullRecord":8193},"LogFile":{"Change":0,"EditOwn":0,"ReadFullRecord":24576},"JobOperations":{"Change":16384,"EditOwn":0,"ReadFullRecord":8195},"AyaNova7Import":{"Change":16384,"EditOwn":0,"ReadFullRecord":0},"Metrics":{"Change":0,"EditOwn":0,"ReadFullRecord":24576},"Locale":{"Change":16386,"EditOwn":0,"ReadFullRecord":32767},"DataFilter":{"Change":2,"EditOwn":32767,"ReadFullRecord":32767},"FormCustom":{"Change":2,"EditOwn":0,"ReadFullRecord":32767}}'
|
'{"User":{"Change":2,"EditOwn":0,"ReadFullRecord":1},"UserOptions":{"Change":2,"EditOwn":0,"ReadFullRecord":1},"Widget":{"Change":34,"EditOwn":256,"ReadFullRecord":17},"ServerState":{"Change":16384,"EditOwn":0,"ReadFullRecord":32767},"License":{"Change":16386,"EditOwn":0,"ReadFullRecord":8193},"LogFile":{"Change":0,"EditOwn":0,"ReadFullRecord":24576},"JobOperations":{"Change":16384,"EditOwn":0,"ReadFullRecord":8195},"AyaNova7Import":{"Change":16384,"EditOwn":0,"ReadFullRecord":0},"Metrics":{"Change":0,"EditOwn":0,"ReadFullRecord":24576},"Locale":{"Change":16386,"EditOwn":0,"ReadFullRecord":32767},"DataFilter":{"Change":2,"EditOwn":32767,"ReadFullRecord":32767},"FormCustom":{"Change":2,"EditOwn":0,"ReadFullRecord":32767}}'
|
||||||
);
|
);
|
||||||
var typeName = _.findKey(this.AYATYPE, function(o) {
|
|
||||||
|
|
||||||
|
var typeName = _.findKey(vm.$gztype, function(o) {
|
||||||
return o == oType;
|
return o == oType;
|
||||||
});
|
});
|
||||||
|
|
||||||
var theRight=AYANOVA_RIGHTS[typeName];
|
var theRight = AYANOVA_RIGHTS[typeName];
|
||||||
// var theType = _.find(this.AYATYPE, function(o) {
|
// var theType = _.find(this.AYATYPE, function(o) {
|
||||||
// return o.value == oType;
|
// return o.value == oType;
|
||||||
// });
|
// });
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import locale from "./api/locale";
|
|||||||
import gzapi from "./api/gzapi";
|
import gzapi from "./api/gzapi";
|
||||||
import gzform from "./api/gzform";
|
import gzform from "./api/gzform";
|
||||||
import roles from "./api/authorizationroles";
|
import roles from "./api/authorizationroles";
|
||||||
|
import gztype from "./api/ayatype";
|
||||||
import "@/assets/css/main.css";
|
import "@/assets/css/main.css";
|
||||||
|
|
||||||
import gzdateandtimepicker from "./components/gzdateandtimepicker.vue";
|
import gzdateandtimepicker from "./components/gzdateandtimepicker.vue";
|
||||||
@@ -28,6 +29,7 @@ import gzdateandtimepicker from "./components/gzdateandtimepicker.vue";
|
|||||||
// LIBS AND GLOBAL ITEMS
|
// LIBS AND GLOBAL ITEMS
|
||||||
// (https://medium.com/js-dojo/use-any-javascript-library-with-vue-js-3f7e2a4974a8)
|
// (https://medium.com/js-dojo/use-any-javascript-library-with-vue-js-3f7e2a4974a8)
|
||||||
//
|
//
|
||||||
|
Object.defineProperty(Vue.prototype, "$gztype", { value: gztype });
|
||||||
Object.defineProperty(Vue.prototype, "$gzrole", { value: roles });
|
Object.defineProperty(Vue.prototype, "$gzrole", { value: roles });
|
||||||
Object.defineProperty(Vue.prototype, "$gzevent", { value: gzeventbus });
|
Object.defineProperty(Vue.prototype, "$gzevent", { value: gzeventbus });
|
||||||
Object.defineProperty(Vue.prototype, "$gzmenu", { value: gzmenu });
|
Object.defineProperty(Vue.prototype, "$gzmenu", { value: gzmenu });
|
||||||
|
|||||||
@@ -372,8 +372,9 @@ export default {
|
|||||||
},
|
},
|
||||||
duplicate() {
|
duplicate() {
|
||||||
this.$gzrole.rights(
|
this.$gzrole.rights(
|
||||||
|
this,
|
||||||
this.$store.state.roles,
|
this.$store.state.roles,
|
||||||
this.$gzrole.AYATYPE.Widget,
|
this.$gztype.Widget,
|
||||||
this.$store.state.userId
|
this.$store.state.userId
|
||||||
);
|
);
|
||||||
//only if not dirty
|
//only if not dirty
|
||||||
|
|||||||
Reference in New Issue
Block a user