]> source.dussan.org Git - archiva.git/commitdiff
Adding base security config
authorMartin Stockhammer <martin_s@apache.org>
Fri, 8 Jan 2021 21:18:14 +0000 (22:18 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Fri, 8 Jan 2021 21:19:14 +0000 (22:19 +0100)
29 files changed:
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/package-lock.json
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/package.json
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/bean-information.spec.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/bean-information.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/error-result.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/security-configuration.spec.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/security-configuration.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/role-routing.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration-routing.module.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration.module.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.html [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.scss [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.spec.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.html [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.scss [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.spec.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/security-configuration.component.html
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/user-routing.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/shared/shared.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/shared/sidemenu/sidemenu.component.html
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/archiva-request.service.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/security.service.spec.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/security.service.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/user.service.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/assets/i18n/en.json

index d214b092c1191f8c7d1b6d5ed9c4a34433c8aee9..4c3d50efd1059b83bcb867cacb4ae14b7deafab7 100644 (file)
         "tslib": "^2.0.0"
       }
     },
+    "@angular/cdk": {
+      "version": "11.0.3",
+      "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-11.0.3.tgz",
+      "integrity": "sha512-hgbJXvZURKBnZawwxUrsZE/3a+HCJh2UhoLIng3cn5Q+WIW/4a37knDl8B9DYKBWrCqeINXNcUHVSKkWc/gjCA==",
+      "requires": {
+        "parse5": "^5.0.0",
+        "tslib": "^2.0.0"
+      },
+      "dependencies": {
+        "parse5": {
+          "version": "5.1.1",
+          "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz",
+          "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==",
+          "optional": true
+        }
+      }
+    },
     "@angular/cli": {
       "version": "11.0.2",
       "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-11.0.2.tgz",
index 3f686c4d74c87318cc80fe681e7ed97c6ef09196..06b66662a10f1a5e42ac55f94aff5496aa160115 100644 (file)
@@ -12,6 +12,7 @@
   "private": true,
   "dependencies": {
     "@angular/animations": "~11.0.2",
+    "@angular/cdk": "^11.0.3",
     "@angular/common": "~11.0.2",
     "@angular/compiler": "~11.0.2",
     "@angular/core": "~11.0.2",
index aa5083d6a5a559a8252fe09e4c768cb80dbd544a..e3d9e88a69b0c060f740071e07c85b32faeb9b7d 100644 (file)
@@ -48,11 +48,11 @@ const routes: Routes = [
     },
 
     {
-        path: 'security', component: HomeComponent,canActivate:[Guard],data:{perm: 'menu.user.section'},
+        path: 'security', component: HomeComponent,canActivate:[Guard],data:{perm: 'menu.security.section'},
         children: [
-            {path: 'users', loadChildren: () => import('./modules/security/user.module').then(m => m.UserModule)},
-            {path: 'roles', loadChildren: () => import('./modules/security/role.module').then(m => m.RoleModule)},
-            {path: 'config', component: SecurityConfigurationComponent},
+            {path: 'users', loadChildren: () => import('@app/modules/security/user.module').then(m => m.UserModule)},
+            {path: 'roles', loadChildren: () => import('@app/modules/security/role.module').then(m => m.RoleModule)},
+            {path: 'config', loadChildren: () => import('@app/modules/security/security-configuration.module').then(m => m.SecurityConfigurationModule)},
         ]
     },
     {path: 'contact', component: ContactComponent},
index d3120237769eb93f5bb4b100aadb6e7595708c2b..9cc81b62184a4422805ae00b212a121e99c34b1f 100644 (file)
@@ -55,7 +55,6 @@ import {TranslateCompiler, TranslateLoader, TranslateModule} from "@ngx-translat
     SearchComponent,
     BrowseComponent,
     UploadComponent,
-    SecurityConfigurationComponent,
   ],
   imports: [
     TranslateModule.forRoot({
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/bean-information.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/bean-information.spec.ts
new file mode 100644 (file)
index 0000000..138cadc
--- /dev/null
@@ -0,0 +1,7 @@
+import { BeanInformation } from './bean-information';
+
+describe('BeanInformation', () => {
+  it('should create an instance', () => {
+    expect(new BeanInformation()).toBeTruthy();
+  });
+});
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/bean-information.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/bean-information.ts
new file mode 100644 (file)
index 0000000..379262a
--- /dev/null
@@ -0,0 +1,7 @@
+export class BeanInformation {
+    id: string;
+    display_name: string;
+    description_key: string;
+    default_description: string;
+    readonly: boolean;
+}
index b54fa848f0416de276d950958ab7c6065eff6c40..4dd034822f2db9312f3d4d98415889447c53c8c8 100644 (file)
@@ -25,4 +25,32 @@ export class ErrorResult {
     constructor(errorMessages: Array<ErrorMessage>) {
         this.error_messages = errorMessages;
     }
+
+    hasMessages() :boolean {
+        return this.error_messages != null && this.error_messages.length > 0;
+    }
+
+    public firstMessage() : ErrorMessage {
+        if (this.error_messages!=null && this.error_messages.length>0) {
+            return this.error_messages[0];
+        } else {
+            return new ErrorMessage();
+        }
+    }
+
+    public firstMessageString() : string {
+        if (this.error_messages!=null && this.error_messages.length>0) {
+            return this.error_messages[0].message;
+        } else {
+            return '';
+        }
+    }
+
+    public toString() : string {
+        if (this.error_messages!=null && this.error_messages.length>0) {
+            return this.error_messages.join(',');
+        } else {
+            return 'status=' + this.status;
+        }
+    }
 }
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/security-configuration.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/security-configuration.spec.ts
new file mode 100644 (file)
index 0000000..a02ee7a
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { SecurityConfiguration } from './security-configuration';
+
+describe('SecurityConfiguration', () => {
+  it('should create an instance', () => {
+    expect(new SecurityConfiguration()).toBeTruthy();
+  });
+});
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/security-configuration.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/model/security-configuration.ts
new file mode 100644 (file)
index 0000000..5d9dc8e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export class SecurityConfiguration {
+
+    active_user_managers: string[];
+    active_rbac_managers: string[];
+    ldap_active: boolean;
+    user_cache_enabled: boolean;
+}
index 1be49d71784a5eba2bf6028b340f7949101997bf..05d9265149180730d1bd42f147e75f4af9a2c9f5 100644 (file)
@@ -31,7 +31,7 @@ import {ManageRolesEditComponent} from "@app/modules/security/roles/manage-roles
 const routes: Routes = [
     {
         path: '', component: ManageRolesComponent, canActivate: [Guard],
-        data: {perm: 'menu.user.roles'},
+        data: {perm: 'menu.security.roles'},
         children: [
             {path: 'list', component: ManageRolesListComponent},
             {path: 'edit/:roleid', component: ManageRolesEditComponent},
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration-routing.module.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration-routing.module.ts
new file mode 100644 (file)
index 0000000..4b40ce4
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {RoutingGuardService as Guard} from "@app/services/routing-guard.service";
+import {SecurityConfigurationComponent} from "./security-configuration/security-configuration.component";
+import {BaseSecurityComponent} from "./security-configuration/base-security/base-security.component";
+import {LdapSecurityComponent} from "./security-configuration/ldap-security/ldap-security.component";
+
+
+/**
+ * You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
+ * that gives the path of the uiPermission map of the user service.
+ */
+
+const routes: Routes = [
+      { path: '', component: SecurityConfigurationComponent,canActivate:[Guard],
+        data: { perm: 'menu.security.config' },
+        children: [
+          {path: 'base', component: BaseSecurityComponent},
+            {path: 'ldap', component: LdapSecurityComponent},
+          {path: '', redirectTo:'base',pathMatch:'full'}
+        ]
+      }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [],
+  declarations: []
+})
+export class SecurityConfigurationRoutingModule { }
+
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration.module.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration.module.ts
new file mode 100644 (file)
index 0000000..e5ee115
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {SharedModule} from "@app/modules/shared/shared.module";
+import {FormsModule, ReactiveFormsModule} from "@angular/forms";
+import {SecurityConfigurationComponent} from "./security-configuration/security-configuration.component";
+import {SecurityConfigurationRoutingModule} from "@app/modules/security/security-configuration-routing.module";
+import { BaseSecurityComponent } from './security-configuration/base-security/base-security.component';
+import { LdapSecurityComponent } from './security-configuration/ldap-security/ldap-security.component';
+
+
+@NgModule({
+    declarations: [
+        SecurityConfigurationComponent,
+        BaseSecurityComponent,
+        LdapSecurityComponent
+    ],
+    exports: [
+        SecurityConfigurationComponent
+    ],
+    imports: [
+        CommonModule,
+        SharedModule,
+        FormsModule,
+        ReactiveFormsModule,
+        SecurityConfigurationRoutingModule
+    ]
+})
+export class SecurityConfigurationModule {
+}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.html
new file mode 100644 (file)
index 0000000..fcf545f
--- /dev/null
@@ -0,0 +1,83 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()">
+    <div class="row">
+        <div class="col-md-4">
+            <div class="drag-container">
+                <div class="section-heading mb-2">{{'security.config.base.user_manager.active_list'|translate}}</div>
+                <div cdkDropList #activeUserManagersList="cdkDropList" [cdkDropListData]="activeUserManagers" [cdkDropListConnectedTo]="[availableUserManagersList]"
+                     class="drop-list-group" (cdkDropListDropped)="drop($event)">
+                    <div class="list-group-item" *ngFor="let item of activeUserManagers" cdkDrag>{{item.id}} - {{item.display_name}}</div>
+                </div>
+            </div>
+        </div>
+        <div class="col-md-4">
+            <div class="drag-container">
+                <div class="section-heading mb-2">{{'security.config.base.user_manager.available_list' |translate}}</div>
+                <div cdkDropList #availableUserManagersList="cdkDropList" [cdkDropListData]="availableUserManagers" [cdkDropListConnectedTo]="[activeUserManagersList]"
+                     class="drop-list-group" (cdkDropListDropped)="drop($event)">
+                    <div class="list-group-item" *ngFor="let item of availableUserManagers" cdkDrag>{{item.id}} - {{item.display_name}}</div>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <div class="row">
+        <div class="col-md-4">
+            <div class="drag-container">
+                <div class="section-heading mb-2">{{'security.config.base.rbac_manager.active_list'|translate}}</div>
+                <div cdkDropList #activeRbacManagersList="cdkDropList" [cdkDropListData]="activeRbacManagers" [cdkDropListConnectedTo]="[availableRbacManagersList]"
+                     class="drop-list-group" (cdkDropListDropped)="drop($event)">
+                    <div class="list-group-item" *ngFor="let item of activeRbacManagers" cdkDrag>{{item.id}} - {{item.display_name}}</div>
+                </div>
+            </div>
+        </div>
+        <div class="col-md-4">
+            <div class="drag-container">
+                <div class="section-heading mb-2">{{'security.config.base.rbac_manager.available_list' |translate}}</div>
+                <div cdkDropList #availableRbacManagersList="cdkDropList" [cdkDropListData]="availableRbacManagers" [cdkDropListConnectedTo]="[activeRbacManagersList]"
+                     class="drop-list-group" (cdkDropListDropped)="drop($event)">
+                    <div class="list-group-item" *ngFor="let item of availableRbacManagers" cdkDrag>{{item.id}} - {{item.display_name}}</div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="form-group row col-md-8">
+        <div class="col-md-2">{{'security.config.base.flags'|translate}}</div>
+        <div class="col-md-4">
+            <div class="form-check">
+                <input class="form-check-input" type="checkbox" formControlName="user_cache_enabled"
+                       id="user_cache_enabled" >
+                <label class="user_cache_enabled " for="user_cache_enabled">
+                    {{'security.config.base.attributes.user_cache_enabled'|translate}}
+                </label>
+            </div>
+        </div>
+
+
+    </div>
+
+    <div class="form-group row" >
+        <div class="col-md-4">
+            <button class="btn btn-primary" [class.disabled]="enableSubmit()?null:'true'"
+                    type="submit">{{'users.edit.submit'|translate}}</button>
+        </div>
+    </div>
+
+</form>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.scss b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.scss
new file mode 100644 (file)
index 0000000..1517b39
--- /dev/null
@@ -0,0 +1,53 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+.drag-container {
+  width: 400px;
+  max-width: 100%;
+  margin: 0 25px 25px 0;
+  display: inline-block;
+  vertical-align: top;
+  background-color: #E9ECEF;
+  padding: 15px;
+  border-radius: 5px;
+}
+
+.drop-list-group  {
+  @extend .list-group;
+  background: white;
+  min-height: 50px;
+}
+
+.cdk-drag-preview  {
+  @extend .list-group-item;
+}
+
+.cdk-drag-placeholder {
+  opacity: 0;
+}
+
+.cdk-drag-animating {
+  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
+}
+
+.cdk-drop-list-receiving extends list-group-item {
+}
+
+.list-group.cdk-drop-list-dragging .list-group-item:not(.cdk-drag-placeholder) {
+  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
+}
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.spec.ts
new file mode 100644 (file)
index 0000000..2487b32
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { BaseSecurityComponent } from './base-security.component';
+
+describe('BaseSecurityComponent', () => {
+  let component: BaseSecurityComponent;
+  let fixture: ComponentFixture<BaseSecurityComponent>;
+
+  beforeEach(async () => {
+    await TestBed.configureTestingModule({
+      declarations: [ BaseSecurityComponent ]
+    })
+    .compileComponents();
+  });
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(BaseSecurityComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/base-security/base-security.component.ts
new file mode 100644 (file)
index 0000000..4b3acf5
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {AfterContentInit, Component, OnInit} from '@angular/core';
+import {ActivatedRoute} from "@angular/router";
+import {RoleService} from "@app/services/role.service";
+import {UserService} from "@app/services/user.service";
+import {FormBuilder} from "@angular/forms";
+import {ToastService} from "@app/services/toast.service";
+import {EditBaseComponent} from "@app/modules/shared/edit-base.component";
+import {SecurityConfiguration} from "@app/model/security-configuration";
+import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
+import {SecurityService} from "@app/services/security.service";
+import {switchMap, tap, withLatestFrom} from 'rxjs/operators';
+import {BeanInformation} from "@app/model/bean-information";
+import {zip} from "rxjs";
+import {ErrorResult} from "@app/model/error-result";
+
+@Component({
+  selector: 'app-base-security',
+  templateUrl: './base-security.component.html',
+  styleUrls: ['./base-security.component.scss']
+})
+export class BaseSecurityComponent extends EditBaseComponent<SecurityConfiguration> implements OnInit, AfterContentInit  {
+
+  activeUserManagers : BeanInformation[] = [];
+  availableUserManagers: BeanInformation[] = [];
+  activeRbacManagers: BeanInformation[] = [];
+  availableRbacManagers: BeanInformation[] = [];
+
+  submitting: boolean = false;
+
+  rbacInfo: Map<string,BeanInformation> = new Map<string, BeanInformation>();
+  userInfo: Map<string,BeanInformation> = new Map<string, BeanInformation>();
+
+  drop(event: CdkDragDrop<string[]>) {
+    console.log("Drop " + event);
+    if (event.previousContainer === event.container) {
+      moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
+    } else {
+      transferArrayItem(event.previousContainer.data,
+          event.container.data,
+          event.previousIndex,
+          event.currentIndex);
+    }
+  }
+
+  constructor(private route: ActivatedRoute,
+              public fb: FormBuilder, private securityService: SecurityService, private toastService: ToastService) {
+    super(fb);
+    super.init(fb.group({
+      user_cache_enabled:[''],
+    }, {}));
+
+
+
+  }
+
+  ngOnInit(): void {
+    zip(this.securityService.getRbacManagers(),this.securityService.getUserManagers()).pipe(tap(([rbacInfo,userInfo])=>{
+      rbacInfo.forEach(info => this.rbacInfo.set(info.id, info));
+      userInfo.forEach(info => this.userInfo.set(info.id, info));
+      console.log("Rbac info " + JSON.stringify(this.rbacInfo));
+      console.log("User info " + JSON.stringify(this.userInfo));
+    }),switchMap(()=>this.securityService.getConfiguration())).subscribe(userConfig=>{
+      this.activeRbacManagers=[];
+      this.activeUserManagers=[];
+      this.availableRbacManagers=[];
+      this.availableUserManagers=[];
+      this.userForm.get('user_cache_enabled').setValue(userConfig.user_cache_enabled);
+      let availableRbacManagers : string[] = Array.from(this.rbacInfo.keys())
+      let availableUserManagers : string[] = Array.from(this.userInfo.keys());
+      userConfig.active_rbac_managers.forEach(rbacId=>{
+        this.activeRbacManagers.push(this.rbacInfo.get(rbacId));
+        availableRbacManagers = availableRbacManagers.filter(item => item != rbacId);
+      });
+      userConfig.active_user_managers.forEach(userId=>{
+        this.activeUserManagers.push(this.userInfo.get(userId));
+        availableUserManagers = availableUserManagers.filter(item => item != userId);
+      });
+      availableRbacManagers.forEach(rbacId => this.availableRbacManagers.push(this.rbacInfo.get(rbacId)));
+      availableUserManagers.forEach(userId => this.availableUserManagers.push(this.userInfo.get(userId)));
+    })
+  }
+
+  createEntity(): SecurityConfiguration {
+    return undefined;
+  }
+
+  onSubmit() {
+    if (this.activeUserManagers.length>0 && this.activeRbacManagers.length>0) {
+      this.submitting=true;
+      let sConfig = new SecurityConfiguration()
+      sConfig.active_user_managers = [];
+      sConfig.active_user_managers = this.activeUserManagers.map(uInfo => uInfo.id);
+      sConfig.active_rbac_managers = this.activeRbacManagers.map(rInfo => rInfo.id);
+      sConfig.user_cache_enabled = this.userForm.get('user_cache_enabled').value;
+      this.securityService.updateConfiguration(sConfig).subscribe(()=>
+          {
+            this.toastService.showSuccessByKey('base-security','security.config.base.submit_success')
+            this.submitting = false;
+          }, ( error :ErrorResult) => {
+            this.toastService.showErrorByKey('base-security','security.config.base.submit_error',
+                {'error':error.toString()})
+            this.submitting = false;
+          }
+      );
+    } else {
+      this.toastService.showErrorByKey('base-security','security.config.base.submit_active_empty')
+    }
+
+  }
+
+  ngAfterContentInit(): void {
+  }
+
+  enableSubmit() : boolean {
+    return !this.submitting && this.activeUserManagers.length>0 && this.activeRbacManagers.length>0 && this.userForm.valid;
+  }
+
+}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.html b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.html
new file mode 100644 (file)
index 0000000..55895d8
--- /dev/null
@@ -0,0 +1,19 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<p>ldap-security works!</p>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.scss b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.scss
new file mode 100644 (file)
index 0000000..343c3b1
--- /dev/null
@@ -0,0 +1,18 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.spec.ts
new file mode 100644 (file)
index 0000000..7de23ee
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { LdapSecurityComponent } from './ldap-security.component';
+
+describe('LdapSecurityComponent', () => {
+  let component: LdapSecurityComponent;
+  let fixture: ComponentFixture<LdapSecurityComponent>;
+
+  beforeEach(async () => {
+    await TestBed.configureTestingModule({
+      declarations: [ LdapSecurityComponent ]
+    })
+    .compileComponents();
+  });
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(LdapSecurityComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/security/security-configuration/ldap-security/ldap-security.component.ts
new file mode 100644 (file)
index 0000000..3c3b095
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-ldap-security',
+  templateUrl: './ldap-security.component.html',
+  styleUrls: ['./ldap-security.component.scss']
+})
+export class LdapSecurityComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit(): void {
+  }
+
+}
index ec4f0f99a73c0970a8ad0b34e70049df8a2ccd74..340af07341d6d4851e4bc0bc424a7d5647800c0d 100644 (file)
   ~ under the License.
   -->
 
-<p>security-configuration works!</p>
+<ul class="nav nav-tabs">
+    <li class="nav-item">
+        <a class="nav-link" routerLink="/security/config/base" routerLinkActive="active" href="#">{{'security.config.base.head' | translate}}</a>
+    </li>
+    <li class="nav-item">
+        <a class="nav-link" routerLink="/security/config/ldap" routerLinkActive="active" href="#">{{'security.config.ldap.head' |translate }}</a>
+    </li>
+</ul>
+
+<router-outlet></router-outlet>
index c1cae57de62f55b040a3c80e41941cc992d8b7b0..6f5f13acf22e0f98757cb016591c17c8c5b5bfbc 100644 (file)
@@ -33,7 +33,7 @@ import {RoutingGuardService as Guard} from "@app/services/routing-guard.service"
 
 const routes: Routes = [
       { path: '', component: ManageUsersComponent,canActivate:[Guard],
-        data: { perm: 'menu.user.manage' },
+        data: { perm: 'menu.security.users' },
         children: [
           {path: 'list', component: ManageUsersListComponent},
           {path: 'add', component: ManageUsersAddComponent},
index 38fc25d711f3189114e38ae8acf7f8bbd4c88a76..ce7f45422ce4513fc405c98037108df536aa086f 100644 (file)
@@ -39,6 +39,7 @@ import { StripLoadingPipe } from './strip-loading.pipe';
 import { ToastComponent } from './toast/toast.component';
 import { UserInfoComponent } from './user-info/user-info.component';
 import {FormsModule} from "@angular/forms";
+import {DragDropModule} from "@angular/cdk/drag-drop";
 
 export { LoadingValue } from './model/loading-value';
 export { PageQuery } from './model/page-query';
@@ -68,9 +69,11 @@ export { PageQuery } from './model/page-query';
         SortedTableHeaderRowComponent,
         WithLoadingPipe,
         StripLoadingPipe,
-        ToastComponent
+        ToastComponent,
+        DragDropModule
     ],
     imports: [
+        DragDropModule,
         CommonModule,
         RouterModule,
         NgbPaginationModule,
index cbded1e956a1577c196d3f8a75b7f8597b24a8c5..670074e17f60db972338efde395c472e3eaf717b 100644 (file)
         <a class="nav-link my-0 py-0" id="admin-reports" routerLink="/admin/reports" routerLinkActive="active" data-toggle="pill"
            [appViewPermission]="perms.menu.admin.reports" role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.admin.reports'|translate}}</a>
     </div>
-    <div class="nav flex-column nav-pills" [appViewPermission]="perms.menu.user.section">
+    <div class="nav flex-column nav-pills" [appViewPermission]="perms.menu.security.section">
         <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true" data-toggle="pill"
-           role="tab" aria-controls="v-pills-home" aria-selected="false">{{'sidemenu.user.section'|translate}}</a>
+           role="tab" aria-controls="v-pills-home" aria-selected="false">{{'sidemenu.security.section'|translate}}</a>
         <a class="nav-link my-0 py-0" id="users-manage" routerLink="/security/users" routerLinkActive="active" data-toggle="pill"
-           role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.user.users'|translate}}</a>
+           role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.security.users'|translate}}</a>
         <a class="nav-link my-0 py-0" id="users-roles" routerLink="/security/roles" routerLinkActive="active" data-toggle="pill"
-           role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.user.roles'|translate}}</a>
+           role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.security.roles'|translate}}</a>
         <a class="nav-link my-0 py-0" id="users-configuration" routerLink="/security/config" routerLinkActive="active" data-toggle="pill"
-           role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.user.config'|translate}}</a>
+           role="tab" aria-controls="v-pills-browse" aria-selected="false">{{'sidemenu.security.config'|translate}}</a>
     </div>
     <div class="nav flex-column nav-pills" >
         <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true" data-toggle="pill"
index 4e8ca0ce0f7bf181d7b9f82de81a50fc9501002e..727032d91faf9f8660474e69019bcd8a80a0f583 100644 (file)
@@ -141,7 +141,19 @@ export class ArchivaRequestService {
     }
 
     public getTranslatedErrorResult(httpError : HttpErrorResponse) : ErrorResult {
+        console.log("Error " + httpError);
+        if (httpError == null) {
+            return new ErrorResult([]);
+        }
         let errorResult = httpError.error as ErrorResult;
+        if (errorResult==null) {
+            if (httpError.statusText!=null) {
+                errorResult = new ErrorResult([ErrorMessage.of(httpError.statusText)]);
+            } else {
+                errorResult = new ErrorResult([]);
+            }
+        }
+        console.log("Returning error " + errorResult);
         errorResult.status = httpError.status;
         if (errorResult.error_messages!=null) {
             for (let message of errorResult.error_messages) {
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/security.service.spec.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/security.service.spec.ts
new file mode 100644 (file)
index 0000000..e73fd63
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { TestBed } from '@angular/core/testing';
+
+import { SecurityService } from './security.service';
+
+describe('SecurityService', () => {
+  let service: SecurityService;
+
+  beforeEach(() => {
+    TestBed.configureTestingModule({});
+    service = TestBed.inject(SecurityService);
+  });
+
+  it('should be created', () => {
+    expect(service).toBeTruthy();
+  });
+});
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/security.service.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/services/security.service.ts
new file mode 100644 (file)
index 0000000..954d448
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Injectable } from '@angular/core';
+import {ArchivaRequestService} from "@app/services/archiva-request.service";
+import {SecurityConfiguration} from "@app/model/security-configuration";
+import {Observable, throwError} from "rxjs";
+import {catchError} from "rxjs/operators";
+import {HttpErrorResponse, HttpResponse} from "@angular/common/http";
+import {BeanInformation} from "@app/model/bean-information";
+
+@Injectable({
+  providedIn: 'root'
+})
+export class SecurityService {
+
+  constructor(private rest:ArchivaRequestService) {
+
+  }
+
+  getConfiguration() : Observable<SecurityConfiguration> {
+    return this.rest.executeRestCall<SecurityConfiguration>("get", "archiva", "security/config", null).pipe(
+        catchError((error: HttpErrorResponse) => {
+          return throwError(this.rest.getTranslatedErrorResult(error));
+        })
+    );
+  }
+
+    updateConfiguration(securityConfiguration : SecurityConfiguration) : Observable<HttpResponse<any>> {
+        return this.rest.executeResponseCall<any>("put", "archiva", "security/config", securityConfiguration).pipe(
+            catchError((error: HttpErrorResponse) => {
+                console.log("Error thrown " + typeof (error));
+                return throwError(this.rest.getTranslatedErrorResult(error));
+            })
+        );
+    }
+
+    getRbacManagers() : Observable<BeanInformation[]> {
+        return this.rest.executeRestCall<BeanInformation[]>("get", "archiva", "security/rbac_managers", null).pipe(
+            catchError((error: HttpErrorResponse) => {
+                return throwError(this.rest.getTranslatedErrorResult(error));
+            })
+        );
+    }
+
+    getUserManagers() : Observable<BeanInformation[]> {
+        return this.rest.executeRestCall<BeanInformation[]>("get", "archiva", "security/user_managers", null).pipe(
+            catchError((error: HttpErrorResponse) => {
+                return throwError(this.rest.getTranslatedErrorResult(error));
+            })
+        );
+    }
+
+}
index fa89b40c53a3281dbbecadd8da4dd1eac5739002..12eea216572a92d31845d302270b4d8ed7690b43 100644 (file)
@@ -45,18 +45,18 @@ export class UserService implements OnInit, OnDestroy {
                 'search': true,
                 'upload': false
             },
+            'security':{
+                'section': false,
+                'roles': false,
+                'users': false,
+                'config': false
+            },
             'admin': {
                 'section': false,
                 'config': false,
                 'status': false,
                 'reports': false
             },
-            'user': {
-                'section': false,
-                'manage': false,
-                'roles': false,
-                'config': false
-            }
         }
     };
     uiPermissions;
@@ -181,21 +181,22 @@ export class UserService implements OnInit, OnDestroy {
                         this.uiPermissions.menu.admin.config = true;
                         this.uiPermissions.menu.admin.reports = true;
                         this.uiPermissions.menu.admin.status = true;
+                        this.uiPermissions.menu.security.section = true;
+                        this.uiPermissions.menu.security.config = true;
                     }
 
                 }
                 case "archiva-manage-users": {
                     if (perm.resource.identifier == '*') {
-                        this.uiPermissions.menu.user.section = true;
-                        this.uiPermissions.menu.user.config = true;
-                        this.uiPermissions.menu.user.manage = true;
-                        this.uiPermissions.menu.user.roles = true;
+                        this.uiPermissions.menu.security.section = true;
+                        this.uiPermissions.menu.security.users = true;
+                        this.uiPermissions.menu.security.roles = true;
                     }
                 }
                 case "redback-configuration-edit": {
                     if (perm.resource.identifier == '*') {
-                        this.uiPermissions.menu.user.section = true;
-                        this.uiPermissions.menu.user.config = true;
+                        this.uiPermissions.menu.security.section = true;
+                        this.uiPermissions.menu.security.config = true;
                     }
                 }
                 case "archiva-upload-file": {
index 645701eae0059e0dc7dbb2c5cdaa71c7a391ee4f..834a1a21ac90b90afdfd7780e0811db21e5b7baf 100644 (file)
@@ -44,8 +44,8 @@
       "status": "System Status",
       "reports": "Reports"
     },
-    "user": {
-      "section": "User",
+    "security": {
+      "section": "Security",
       "users": "Manage Users",
       "roles": "Manage Roles",
       "config": "Security Configuration"
       "assignable": "Assignable"
     }
   },
+  "security": {
+    "config": {
+      "base": {
+        "head": "Base Configuration",
+        "flags": "Flags",
+        "user_manager" : {
+          "active_list" : "Active User Managers",
+          "available_list" : "Available User Managers"
+        },
+        "rbac_manager" : {
+          "active_list": "Active RBAC Managers",
+          "available_list" : "Available RBAC Managers"
+        },
+        "attributes": {
+          "ldap_active": "LDAP Active",
+          "user_cache_enabled": "User Cache Enabled"
+        },
+        "submit_success": "The Changes were submitted successfully",
+        "submit_error": "There was an error during submit: {error}",
+        "submit_active_empty": "There must be at least on active User and RBAC Manager defined"
+      },
+      "ldap": {
+        "head": "LDAP Configuration"
+      }
+    }
+  },
   "permissions": {
     "attributes": {
       "permission": "Permission",