User permissions for editing dashboards
-
I recently allowed one of our techs limited access to a running Mango. She is now exploring dashboards, and keeps getting errors saving/viewing her work. In exploring, I discovered that I could only enable her to do so by giving her superadmin (not just admin) permission. Is this correct? I would hope I could let her do her work as a user without having to worry about potential mistakes that might harm the running environment.
Please help me better understand this issue.
-
Hi Aldo,
Tis a bug you are describing. Caught and modified. You can fix this yourself, and it will be in the next version of the module. To fix, you'll need to edit two files in the dashboards module. You may need to clear the browser cache, but you will not need to restart.
- Mango/web/modules/dashboards/web/js/mango-3.0/directives/jsonStore.js
Add between lines 28-29:
angular.extend(item, $scope.item);
- Mango/web/modules/dashboards/web/mdAdmin/views/examples/playArea.html
change...
<ma-json-store xid="play-area-{{user.username}}" item="playArea" value="paVal"></ma-json-store>
to...
<ma-json-store xid="play-area-{{user.username}}" item="playArea" value="paVal" ng-init="playArea={readPermission: 'user', editPermission: 'user'}"> </ma-json-store>
as described in this commit: https://github.com/infiniteautomation/ma-dashboards/commit/d0d51811c2a1bf1f9139eb391bb271111c0a5dfd
Note that the user will need to have the permissions group 'user'
- Mango/web/modules/dashboards/web/js/mango-3.0/directives/jsonStore.js
-
Thanks, but I've implemented your changes and I still get the error. While I can see the changes in the "Result" window, when I save, then go to "Play Area View Only" I get nothing, but the REST API errors shows:
Mango REST API errors
Jul 27, 2016 1:41 PM
401 Unauthorized
GET /rest/v1/json-data/play-area-Sue -
My sincerest apologies! I forgot to say you'll want to update the database via the SQL console for the record that already exists, something like,
update jsonData set readPermission='user', editPermission='user' where name='play-area-Sue'
Sorry!
-
Yes! That fixed it (although oddly it didn't seem to actually update the db on my first attempt); Thanks!
-
No problem, thanks for bringing it to our attention! Also, in case you didn't see it, Will just posted a link to some video tutorials for getting going with Angular and the dashboards: http://infiniteautomation.com/forum/topic/2377/mango-dashboard-3-x-video-training-series
Could be interesting for you or your tech!