Add team permissions support
This commit is contained in:
parent
97fa69a361
commit
1cd4fa8d9b
6 changed files with 120 additions and 39 deletions
|
@ -1076,7 +1076,14 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula
|
|||
});
|
||||
}
|
||||
|
||||
function OrgViewCtrl($scope, Restangular, $routeParams) {
|
||||
function OrgViewCtrl($rootScope, $scope, Restangular, $routeParams) {
|
||||
$('.info-icon').popover({
|
||||
'trigger': 'hover',
|
||||
'html': true
|
||||
});
|
||||
|
||||
$rootScope.title = 'Loading...';
|
||||
|
||||
var orgname = $routeParams.orgname;
|
||||
|
||||
var loadOrganization = function() {
|
||||
|
@ -1084,11 +1091,24 @@ function OrgViewCtrl($scope, Restangular, $routeParams) {
|
|||
getOrganization.get().then(function(resp) {
|
||||
$scope.organization = resp;
|
||||
$scope.loading = false;
|
||||
|
||||
$rootScope.title = orgname;
|
||||
}, function() {
|
||||
$scope.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.setRole = function(teamname, role) {
|
||||
$scope.organization.teams[teamname].role = role;
|
||||
|
||||
var updateTeam = Restangular.one(getRestUrl('organization', orgname, 'team', teamname));
|
||||
var data = $scope.organization.teams[teamname];
|
||||
updateTeam.customPUT(data).then(function(resp) {
|
||||
}, function() {
|
||||
$('#cannotChangeTeamModal').modal({});
|
||||
});
|
||||
};
|
||||
|
||||
loadOrganization();
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue