Skip to content

Commit 0831b52

Browse files
committedMar 7, 2022
[container] doing permission validation only in container
1 parent 60f5d47 commit 0831b52

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed
 

‎frontend/express/public/javascripts/countly/countly.template.js

+2
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,7 @@ var AppRouter = Backbone.Router.extend({
816816
title: node.text,
817817
url: node.url,
818818
icon: node.icon,
819+
permission: node.permission,
819820
node: node
820821
/*
821822
Following secondary params are simply passed to registry, but not directly used for now:
@@ -949,6 +950,7 @@ var AppRouter = Backbone.Router.extend({
949950
priority: node.priority,
950951
title: node.text,
951952
url: node.url,
953+
permission: node.permission,
952954
node: node
953955
/*
954956
Following secondary params are simply passed to registry, but not directly used for now:

‎frontend/express/public/javascripts/countly/vue/components/sidebar.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global app, jQuery, CV, Vue, countlyGlobal, _, Backbone, store, moment, countlyCommon, countlyAuth */
1+
/* global app, jQuery, CV, Vue, countlyGlobal, _, Backbone, store, moment, countlyCommon */
22

33
(function(countlyVue, $) {
44

@@ -71,25 +71,25 @@
7171
* @param {string} permission - permission name
7272
* @returns {boolean} - true if permission granted
7373
**/
74-
var checkMenuPermission = function(permission) {
74+
/*var checkMenuPermission = function(permission) {
7575
if (permission) {
7676
return countlyAuth.validateRead(permission);
7777
}
7878
return countlyAuth.validateGlobalAdmin();
79-
};
79+
};*/
8080

8181
/**
8282
* Check feature permission before adding sidebar
8383
* @memberof app
8484
* @param {string} permission - permission name
8585
* @returns {boolean} - true if permission granted
8686
**/
87-
var checkSubMenuPermission = function(permission) {
87+
/*var checkSubMenuPermission = function(permission) {
8888
if (permission) {
8989
return countlyAuth.validateRead(permission);
9090
}
9191
return countlyAuth.validateGlobalAdmin();
92-
};
92+
};*/
9393

9494
var AppsMixin = {
9595
computed: {
@@ -444,7 +444,7 @@
444444
}
445445

446446
var menu = this.menus.filter(function(val) {
447-
if (val.category === "management" && checkSubMenuPermission(val.name)) {
447+
if (val.category === "management") {
448448
return true;
449449
}
450450
return false;

‎frontend/express/public/javascripts/countly/vue/container.js

-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@
105105
if (data && data.permission) {
106106
return countlyAuth.validateRead(data.permission);
107107
}
108-
else if (data && data.node && data.node.permission) {
109-
return countlyAuth.validateRead(data.permission);
110-
}
111108
return true;
112109
});
113110
}

0 commit comments

Comments
 (0)
Please sign in to comment.