1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +01:00

accessAll is only for collection assignments

This commit is contained in:
Kyle Spearrin 2018-10-18 12:25:25 -04:00
parent e96cbe2710
commit 726c323fe1
2 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@
<tr *ngFor="let u of searchedUsers"> <tr *ngFor="let u of searchedUsers">
<td class="table-list-checkbox" (click)="check(u)"> <td class="table-list-checkbox" (click)="check(u)">
<input type="checkbox" [(ngModel)]="u.checked" name="{{u.id.substr(0,8)}}_Checked" <input type="checkbox" [(ngModel)]="u.checked" name="{{u.id.substr(0,8)}}_Checked"
[disabled]="u.accessAll" (change)="selectedChanged(u)" appStopProp> [disabled]="entity === 'collection' && u.accessAll" (change)="selectedChanged(u)" appStopProp>
</td> </td>
<td width="30" (click)="check(u)"> <td width="30" (click)="check(u)">
<app-avatar [data]="u.name || u.email" [email]="u.email" size="25" [circle]="true" <app-avatar [data]="u.name || u.email" [email]="u.email" size="25" [circle]="true"

View File

@ -63,7 +63,7 @@ export class EntityUsersComponent implements OnInit {
const response = await this.apiService.getGroupUsers(this.organizationId, this.entityId); const response = await this.apiService.getGroupUsers(this.organizationId, this.entityId);
if (response != null && users.data.length > 0) { if (response != null && users.data.length > 0) {
response.forEach((s) => { response.forEach((s) => {
const user = users.data.filter((u) => !u.accessAll && u.id === s); const user = users.data.filter((u) => u.id === s);
if (user != null && user.length > 0) { if (user != null && user.length > 0) {
(user[0] as any).checked = true; (user[0] as any).checked = true;
} }
@ -83,7 +83,7 @@ export class EntityUsersComponent implements OnInit {
} }
this.allUsers.forEach((u) => { this.allUsers.forEach((u) => {
if (u.accessAll) { if (this.entity === 'collection' && u.accessAll) {
(u as any).checked = true; (u as any).checked = true;
} }
if ((u as any).checked) { if ((u as any).checked) {
@ -93,7 +93,7 @@ export class EntityUsersComponent implements OnInit {
} }
check(u: OrganizationUserUserDetailsResponse) { check(u: OrganizationUserUserDetailsResponse) {
if (u.accessAll) { if (this.entity === 'collection' && u.accessAll) {
return; return;
} }
(u as any).checked = !(u as any).checked; (u as any).checked = !(u as any).checked;
@ -118,7 +118,7 @@ export class EntityUsersComponent implements OnInit {
async submit() { async submit() {
try { try {
if (this.entity === 'group') { if (this.entity === 'group') {
const selections = this.users.filter((u) => (u as any).checked && !u.accessAll).map((u) => u.id); const selections = this.users.filter((u) => (u as any).checked).map((u) => u.id);
this.formPromise = this.apiService.putGroupUsers(this.organizationId, this.entityId, selections); this.formPromise = this.apiService.putGroupUsers(this.organizationId, this.entityId, selections);
} else { } else {
const selections = this.users.filter((u) => (u as any).checked && !u.accessAll) const selections = this.users.filter((u) => (u as any).checked && !u.accessAll)