Skip to content

Commit

Permalink
Merge pull request goharbor#7062 from jwangyangls/userListPermission
Browse files Browse the repository at this point in the history
fix get users list about permission issue
  • Loading branch information
zhoumeina authored Mar 4, 2019
2 parents 62bb10d + 1e17036 commit 685e590
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
6 changes: 6 additions & 0 deletions src/portal/src/app/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -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[])
Expand Down

0 comments on commit 685e590

Please sign in to comment.