mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-30 07:58:51 +00:00
feat(console): authorizations from user context, add grants to auth user view, fix app saving (#895)
* user grant on project * grant in auth user, enable creation, fix inv regex * use autocomplete solutions, section for usre ctx * user grant create for user context * fix edit from table * fix create context * fix authorization to write * grant overview component * fix user grants without context * lint * turn table highlighting off, rm logs * fix app name saving * fix table refresh for project grants * translate toast * i18n * lint * Update console/src/assets/i18n/de.json Co-authored-by: Florian Forster <[email protected]> Co-authored-by: Florian Forster <[email protected]>
This commit is contained in:
co-authored by
Florian Forster
parent
afa38aa2c2
commit
78e5c26015
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { GrantsComponent } from './grants.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GrantsComponent,
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class GrantsRoutingModule { }
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="max-width-container">
|
||||
<h2>{{ 'GRANTS.TITLE' | translate }}</h2>
|
||||
<p class="desc">{{'GRANTS.DESC' | translate }}</p>
|
||||
<app-user-grants
|
||||
[displayedColumns]="['select', 'user', 'org', 'projectId', 'creationDate', 'changeDate', 'roleNamesList']"
|
||||
[disableWrite]="((['user.grant.write$'] | hasRole) | async) == false"
|
||||
[disableDelete]="((['user.grant.delete$'] | hasRole) | async) == false">
|
||||
</app-user-grants>
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
.desc {
|
||||
color: var(--grey);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GrantsComponent } from './grants.component';
|
||||
|
||||
describe('GrantsComponent', () => {
|
||||
let component: GrantsComponent;
|
||||
let fixture: ComponentFixture<GrantsComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [GrantsComponent],
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(GrantsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-grants',
|
||||
templateUrl: './grants.component.html',
|
||||
styleUrls: ['./grants.component.scss'],
|
||||
})
|
||||
export class GrantsComponent { }
|
||||
@@ -0,0 +1,24 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||
import { UserGrantsModule } from 'src/app/modules/user-grants/user-grants.module';
|
||||
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
||||
|
||||
import { GrantsRoutingModule } from './grants-routing.module';
|
||||
import { GrantsComponent } from './grants.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
GrantsComponent,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
GrantsRoutingModule,
|
||||
UserGrantsModule,
|
||||
TranslateModule,
|
||||
HasRoleModule,
|
||||
HasRolePipeModule,
|
||||
],
|
||||
})
|
||||
export class GrantsModule { }
|
||||
Reference in New Issue
Block a user