Question
Override getViewOptions after a check current user access!
19:56 Sep 17, 2022
I created an Operation Permission that will check if the user has limited access to the section and override the getViewOptions but the problem is getViewOptions was run first before the RightUtilities.checkCanExecuteOperation which checks the access of the user.
How can I able to check the user access and then override the getViewOptions?
getViewOptions: function () { var CanManageAccessRight = this.get("CanManageAccessRight"); if (!CanManageAccessRight) { return this.Ext.create("Terrasoft.BaseViewModelCollection"); } else { return this.callParent(arguments); } }
checkCanManageAccessRight: function(callback) { RightUtilities.checkCanExecuteOperation({ operation: "CanManageAccessRight" }, function (result) { this.set("CanManageAccessRight", result); }, this); }
Like
1 comments
12:19 Sep 19, 2022
Hello,
You need to review which function is called before the getViewOptions method in the call stack in the developer console and use the operation permission in that method and only then call the getViewOptions method or not based on the result of the checkCanExecuteOperation method execution.
Show all comments