Merge pull request #7062 from jwangyangls/userListPermission

fix get users list about permission issue
This commit is contained in:
Mia ZHOU 2019-03-04 16:46:09 +08:00 committed by GitHub
commit 685e590514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -94,7 +94,7 @@ export class AddMemberComponent implements AfterViewChecked, OnInit, OnDestroy {
hasProjectAdminRole = (<Project>resolverData['projectResolver']).has_project_admin_role;
}
if (hasProjectAdminRole) {
this.userService.getUsers()
this.userService.getUsersNameList()
.then(users => {
this.userLists = users;
});

View File

@ -20,6 +20,7 @@ import { User, LDAPUser } from './user';
import LDAPUsertoUser from './user';
const userMgmtEndpoint = '/api/users';
const userListSearch = '/api/users/search';
const ldapUserEndpoint = '/api/ldap/users';
/**
@ -39,6 +40,11 @@ export class UserService {
}
// Get the user list
getUsersNameList(): Promise<User[]> {
return this.http.get(userListSearch, HTTP_GET_OPTIONS).toPromise()
.then(response => response.json() as User[])
.catch(error => this.handleError(error));
}
getUsers(): Promise<User[]> {
return this.http.get(userMgmtEndpoint, HTTP_GET_OPTIONS).toPromise()
.then(response => response.json() as User[])