mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 16:48:30 +01:00
Make role name consistent.
This commit is contained in:
parent
afdbcc2b62
commit
3c95bbd53a
@ -1,7 +1,7 @@
|
||||
<a *ngIf="hasSignedIn" [routerLink]="['/harbor', 'projects']">< {{'PROJECT_DETAIL.PROJECTS' | translate}}</a>
|
||||
<a *ngIf="!hasSignedIn" [routerLink]="['/harbor', 'sign-in']">< {{'SEARCH.BACK' | translate}}</a>
|
||||
|
||||
<h1 class="sub-header-title">{{currentProject.name}} <span class="role-label" *ngIf="isMember">{{roleName | translate}}</span> <span class="role-label" *ngIf="isSystemAdmin">{{ 'MEMBER.SYS_ADMIN' | translate}}</span></h1>
|
||||
<h1 class="sub-header-title">{{currentProject.name}} <span class="role-label" *ngIf="isMember">{{roleName | translate}}</span></h1>
|
||||
<nav class="subnav sub-nav-bg-color">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
|
@ -24,19 +24,17 @@ export class ProjectRoutingResolver implements Resolve<Project>{
|
||||
if(project) {
|
||||
let currentUser = this.sessionService.getCurrentUser();
|
||||
if(currentUser) {
|
||||
let projectMembers = this.sessionService.getProjectMembers();
|
||||
if(projectMembers) {
|
||||
let currentMember = projectMembers.find(m=>m.user_id === currentUser.user_id);
|
||||
if(currentMember) {
|
||||
project.is_member = true;
|
||||
project.has_project_admin_role = (currentMember.role_name === 'projectAdmin');
|
||||
project.role_name = currentMember.role_name;
|
||||
}
|
||||
}
|
||||
if(currentUser.has_admin_role === 1) {
|
||||
project.has_project_admin_role = true;
|
||||
project.role_name = 'sysAdmin';
|
||||
} else {
|
||||
let projectMembers = this.sessionService.getProjectMembers();
|
||||
if(projectMembers) {
|
||||
let currentMember = projectMembers.find(m=>m.user_id === currentUser.user_id);
|
||||
if(currentMember) {
|
||||
project.is_member = true;
|
||||
project.has_project_admin_role = (currentMember.role_name === 'projectAdmin');
|
||||
project.role_name = currentMember.role_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return project;
|
||||
|
Loading…
Reference in New Issue
Block a user