How to use the @harbor/ui.USERSTATICPERMISSION.MEMBER function in @harbor/ui

To help you get started, we’ve selected a few @harbor/ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github goharbor / harbor / src / portal / src / app / project / summary / summary.component.ts View on Github external
ngOnInit() {
    this.projectId = this.route.snapshot.parent.params['id'];

    const permissions = [
      { resource: USERSTATICPERMISSION.MEMBER.KEY, action: USERSTATICPERMISSION.MEMBER.VALUE.LIST },
      { resource: USERSTATICPERMISSION.QUOTA.KEY, action: USERSTATICPERMISSION.QUOTA.VALUE.READ },
    ];

    this.userPermissionService.hasProjectPermissions(this.projectId, permissions).subscribe((results: Array) => {
      this.showProjectMemberInfo = results[0];
      this.showQuotaInfo = results[1];
    });

    this.projectService.getProjectSummary(this.projectId).subscribe(res => {
      this.summaryInformation = res;
    }, error => {
      this.errorHandler.error(error);
    });
  }
github goharbor / harbor / src / portal / src / app / project / member / member.component.ts View on Github external
getMemberPermissionRule(projectId: number): void {
    let hasCreateMemberPermission = this.userPermissionService.getPermission(projectId,
      USERSTATICPERMISSION.MEMBER.KEY, USERSTATICPERMISSION.MEMBER.VALUE.CREATE);
    let hasUpdateMemberPermission = this.userPermissionService.getPermission(projectId,
      USERSTATICPERMISSION.MEMBER.KEY, USERSTATICPERMISSION.MEMBER.VALUE.UPDATE);
    let hasDeleteMemberPermission = this.userPermissionService.getPermission(projectId,
      USERSTATICPERMISSION.MEMBER.KEY, USERSTATICPERMISSION.MEMBER.VALUE.DELETE);
    forkJoin(hasCreateMemberPermission, hasUpdateMemberPermission, hasDeleteMemberPermission).subscribe(MemberRule => {
      this.hasCreateMemberPermission = MemberRule[0] as boolean;
      this.hasUpdateMemberPermission = MemberRule[1] as boolean;
      this.hasDeleteMemberPermission = MemberRule[2] as boolean;
    }, error => this.errorHandler.error(error));
  }
}
github goharbor / harbor / src / portal / src / app / project / member / member.component.ts View on Github external
getMemberPermissionRule(projectId: number): void {
    let hasCreateMemberPermission = this.userPermissionService.getPermission(projectId,
      USERSTATICPERMISSION.MEMBER.KEY, USERSTATICPERMISSION.MEMBER.VALUE.CREATE);
    let hasUpdateMemberPermission = this.userPermissionService.getPermission(projectId,
      USERSTATICPERMISSION.MEMBER.KEY, USERSTATICPERMISSION.MEMBER.VALUE.UPDATE);
    let hasDeleteMemberPermission = this.userPermissionService.getPermission(projectId,
      USERSTATICPERMISSION.MEMBER.KEY, USERSTATICPERMISSION.MEMBER.VALUE.DELETE);
    forkJoin(hasCreateMemberPermission, hasUpdateMemberPermission, hasDeleteMemberPermission).subscribe(MemberRule => {
      this.hasCreateMemberPermission = MemberRule[0] as boolean;
      this.hasUpdateMemberPermission = MemberRule[1] as boolean;
      this.hasDeleteMemberPermission = MemberRule[2] as boolean;
    }, error => this.errorHandler.error(error));
  }
}