mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Small progress on #2014
This commit is contained in:
@@ -67,7 +67,7 @@ func Register(r *macaron.Macaron) {
|
|||||||
// users
|
// users
|
||||||
r.Group("/users", func() {
|
r.Group("/users", func() {
|
||||||
r.Get("/:id", wrap(GetUserById))
|
r.Get("/:id", wrap(GetUserById))
|
||||||
r.Get("/:id/org", wrap(GetUserOrgList))
|
r.Get("/:id/orgs", wrap(GetUserOrgList))
|
||||||
r.Put("/:id", bind(m.UpdateUserCommand{}), wrap(UpdateUser))
|
r.Put("/:id", bind(m.UpdateUserCommand{}), wrap(UpdateUser))
|
||||||
}, reqGrafanaAdmin)
|
}, reqGrafanaAdmin)
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function (angular) {
|
|||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
if ($routeParams.id) {
|
if ($routeParams.id) {
|
||||||
$scope.getUser($routeParams.id);
|
$scope.getUser($routeParams.id);
|
||||||
|
$scope.getUserOrgs($routeParams.id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,6 +50,12 @@ function (angular) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.getUserOrgs = function(id) {
|
||||||
|
backendSrv.get('/api/users/' + id + '/orgs').then(function(orgs) {
|
||||||
|
$scope.orgs = orgs;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$scope.update = function() {
|
$scope.update = function() {
|
||||||
if (!$scope.userForm.$valid) { return; }
|
if (!$scope.userForm.$valid) { return; }
|
||||||
|
|
||||||
|
|||||||
@@ -94,5 +94,21 @@
|
|||||||
<br>
|
<br>
|
||||||
<button type="submit" class="pull-right btn btn-success" ng-click="updatePermissions()">Update</button>
|
<button type="submit" class="pull-right btn btn-success" ng-click="updatePermissions()">Update</button>
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
Organizations
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<table class="grafana-options-table">
|
||||||
|
<tr ng-repeat="org in orgs">
|
||||||
|
<td style="width: 98%"><strong>Name: </strong> {{org.name}}</td>
|
||||||
|
<td><strong>Role: </strong> {{org.role}}</td>
|
||||||
|
<td class="nobg max-width-btns">
|
||||||
|
<span class="label label-info" ng-show="org.orgId === user.orgId">
|
||||||
|
Current
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user