mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-23 15:21:35 +01:00
Merge pull request #7062 from jwangyangls/userListPermission
fix get users list about permission issue
This commit is contained in:
commit
685e590514
@ -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;
|
||||
});
|
||||
|
@ -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[])
|
||||
|
Loading…
Reference in New Issue
Block a user