diff --git a/client/src/app/domain/models/meetings/meeting.ts b/client/src/app/domain/models/meetings/meeting.ts index e2f5aa257d..483aed4349 100644 --- a/client/src/app/domain/models/meetings/meeting.ts +++ b/client/src/app/domain/models/meetings/meeting.ts @@ -209,7 +209,7 @@ export class Settings { export class Meeting extends BaseModel { public static COLLECTION = `meeting`; - public static ACCESSIBILITY_FIELD: keyof Meeting = `projector_countdown_default_time`; + public static ACCESSIBILITY_FIELD: keyof Meeting = `language`; public imported_at!: number; diff --git a/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts b/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts index d7d53681b6..1118dbece7 100644 --- a/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/history/components/history-list/history-list.component.ts @@ -5,7 +5,6 @@ import { ActivatedRoute } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { Observable, Subject } from 'rxjs'; import { Collection, Fqid, Id } from 'src/app/domain/definitions/key-types'; -import { OML } from 'src/app/domain/definitions/organization-permission'; import { Selectable } from 'src/app/domain/interfaces'; import { BaseModel } from 'src/app/domain/models/base/base-model'; import { HistoryPosition, HistoryPresenterService } from 'src/app/gateways/presenter/history-presenter.service'; @@ -93,10 +92,6 @@ export class HistoryListComponent extends BaseMeetingComponent implements OnInit } } - public get isSuperadmin(): boolean { - return this.operator.hasOrganizationPermissions(OML.superadmin); - } - public constructor( protected override translate: TranslateService, private viewModelStore: ViewModelStoreService, diff --git a/client/src/app/site/pages/meetings/pages/participants/modules/groups/components/group-list/group-list.component.ts b/client/src/app/site/pages/meetings/pages/participants/modules/groups/components/group-list/group-list.component.ts index ea528557e5..8b94770e1b 100644 --- a/client/src/app/site/pages/meetings/pages/participants/modules/groups/components/group-list/group-list.component.ts +++ b/client/src/app/site/pages/meetings/pages/participants/modules/groups/components/group-list/group-list.component.ts @@ -297,6 +297,6 @@ export class GroupListComponent extends BaseMeetingComponent implements OnInit, * Function to allow to edit the external_id */ public get allowExternalId(): boolean { - return this.operator.isMeetingAdmin || this.operator.isSuperAdmin; + return this.operator.isMeetingAdmin || this.operator.canSkipPermissionCheck; } } diff --git a/client/src/app/site/pages/meetings/view-models/view-meeting.ts b/client/src/app/site/pages/meetings/view-models/view-meeting.ts index d3cd1a5c41..43ca146879 100644 --- a/client/src/app/site/pages/meetings/view-models/view-meeting.ts +++ b/client/src/app/site/pages/meetings/view-models/view-meeting.ts @@ -139,6 +139,10 @@ export class ViewMeeting extends BaseHasMeetingUsersViewModel { public canBeEnteredBy(user: ViewUser): boolean { return !this.locked_from_inside || user.group_ids(this.id).length > 0; } + + public canEditMeetingSetting(user: ViewUser): boolean { + return user.getMeetingUser(this.id)?.group_ids.includes(this.meeting.admin_group_id); + } } interface IMeetingRelations { motions_default_workflow: ViewMotionWorkflow; diff --git a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-add-to-meetings/account-add-to-meetings.component.ts b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-add-to-meetings/account-add-to-meetings.component.ts index 09c19168e1..9e5491add5 100644 --- a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-add-to-meetings/account-add-to-meetings.component.ts +++ b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-add-to-meetings/account-add-to-meetings.component.ts @@ -109,7 +109,7 @@ export class AccountAddToMeetingsComponent extends BaseUiComponent implements On .getViewModelListObservable() .pipe( map(meetings => - this.operator.isSuperAdmin + this.operator.canSkipPermissionCheck ? meetings.filter(meeting => !meeting.locked_from_inside) : meetings.filter( meeting => this.operator.isInMeeting(meeting.id) && !meeting.locked_from_inside diff --git a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.ts b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.ts index 3e0512ce7c..ce7bbf29d1 100644 --- a/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.ts +++ b/client/src/app/site/pages/organization/pages/accounts/pages/account-detail/components/account-detail/account-detail.component.ts @@ -57,7 +57,10 @@ export class AccountDetailComponent extends BaseComponent implements OnInit { } public get orgaManagementLevelChangeDisabled(): boolean { - return this.user?.id === this.operator.operatorId && this.operator.isSuperAdmin; + return ( + this.user?.id === this.operator.operatorId && + (this.operator.isSuperAdmin || this.operator.isOrgaManager || this.operator.isAccountAdmin) + ); } @ViewChild(UserDetailViewComponent, { static: false }) @@ -253,7 +256,7 @@ export class AccountDetailComponent extends BaseComponent implements OnInit { is_public: meeting.publicAccessPossible(), is_accessible: (meeting.canAccess() && this.operator.isInMeeting(meeting.id)) || - (!meeting.locked_from_inside && this.operator.isSuperAdmin) + (!meeting.locked_from_inside && this.operator.canSkipPermissionCheck) }; }); this._tableData = tableData; diff --git a/client/src/app/site/pages/organization/pages/accounts/pages/account-list/components/account-list/account-list.component.ts b/client/src/app/site/pages/organization/pages/accounts/pages/account-list/components/account-list/account-list.component.ts index 214eec4379..35ad952874 100644 --- a/client/src/app/site/pages/organization/pages/accounts/pages/account-list/components/account-list/account-list.component.ts +++ b/client/src/app/site/pages/organization/pages/accounts/pages/account-list/components/account-list/account-list.component.ts @@ -113,7 +113,7 @@ export class AccountListComponent extends BaseListViewComponent { const meetings = this.meetingRepo.getViewModelList(); const result = await this.choiceService.open({ title, - choices: this.operator.isSuperAdmin + choices: this.operator.canSkipPermissionCheck ? meetings.filter(meeting => !meeting.locked_from_inside) : meetings.filter(meeting => this.operator.isInMeeting(meeting.id) && !meeting.locked_from_inside), multiSelect: true, diff --git a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html index e2adcf484c..faefaccad9 100644 --- a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html +++ b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.html @@ -21,7 +21,7 @@ @if (meeting.isArchived) { {{ 'Archived' | translate }} } - + @if (isTemplateMeeting) {
star @@ -131,7 +131,7 @@ - @if (!meeting.isArchived && (meeting?.canBeEnteredBy(operator.user) || operator.isSuperAdmin)) { + @if (!meeting.isArchived && (meeting?.canBeEnteredBy(operator.user) || operator.canSkipPermissionCheck)) { edit {{ 'Edit' | translate }} @@ -145,7 +145,7 @@ {{ 'Public template' | translate }} } - @if (!isLockedFromInside) { + @if (canEditMeetingSetting) { } - - + @if (canEditMeetingSetting) { + + + } diff --git a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts index 23d81a2c51..2bb29eef35 100644 --- a/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/modules/committee-meeting-preview/committee-meeting-preview.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ViewEncapsulation } from '@angular/core'; +import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { CML, OML } from 'src/app/domain/definitions/organization-permission'; import { MeetingControllerService } from 'src/app/site/pages/meetings/services/meeting-controller.service'; @@ -16,7 +16,7 @@ import { MeetingService } from '../services/meeting.service'; styleUrls: [`./committee-meeting-preview.component.scss`], encapsulation: ViewEncapsulation.None }) -export class CommitteeMeetingPreviewComponent { +export class CommitteeMeetingPreviewComponent implements OnInit { @Input() public meeting!: ViewMeeting; @Input() public committee!: ViewCommittee; @Input() public isCMAndRequireDuplicateFrom!: boolean; @@ -64,6 +64,12 @@ export class CommitteeMeetingPreviewComponent { return this.meeting?.locked_from_inside; } + public get canEditMeetingSetting(): boolean { + return this._canEditMeetingSetting; + } + + private _canEditMeetingSetting = true; + public constructor( private translate: TranslateService, private meetingRepo: MeetingControllerService, @@ -72,6 +78,15 @@ export class CommitteeMeetingPreviewComponent { public operator: OperatorService ) {} + /** + * Get the subject + */ + public ngOnInit(): void { + if (this.isLockedFromInside && !this.operator.isSuperAdmin) { + this._canEditMeetingSetting = this.meeting.canEditMeetingSetting(this.operator.user); + } + } + public async onArchive(): Promise { const title = this.translate.instant(`Are you sure you want to archive this meeting?`); const content = this.translate.instant(`Attention: This action cannot be undone!`); diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts index 8b3aba6e45..df05e7d6ea 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-meeting/components/meeting-edit/meeting-edit.component.ts @@ -277,7 +277,7 @@ export class MeetingEditComponent extends BaseComponent implements OnInit { private onAfterCreateForm(): void { this.enableFormControls(); - if (!this.operator.isSuperAdmin && !this.isMeetingAdmin && !this.isCreateView) { + if (!this.operator.canSkipPermissionCheck && !this.isMeetingAdmin && !this.isCreateView) { Object.keys(this.meetingForm.controls).forEach(controlName => { if (!ORGA_ADMIN_ALLOWED_CONTROLNAMES.includes(controlName)) { this.meetingForm.get(controlName)!.disable(); @@ -347,7 +347,7 @@ export class MeetingEditComponent extends BaseComponent implements OnInit { private async doUpdateMeeting(): Promise { const options = - this.operator.isSuperAdmin && !this.isMeetingAdmin && this.editMeeting?.locked_from_inside + this.operator.canSkipPermissionCheck && !this.isMeetingAdmin && this.editMeeting?.locked_from_inside ? {} : this.getUsersToUpdateForMeetingObject(); await this.meetingRepo.update(this.sanitizePayload(this.getPayload()), { diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html index 4008772147..355793f539 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/modules/committee-detail-view/components/committee-detail-view/committee-detail-view.component.html @@ -1,6 +1,6 @@ this.operator.isInMeeting(meeting.id) || - this.operator.isSuperAdmin || + this.operator.canSkipPermissionCheck || (meeting.publicAccessPossible() && this.operator.isAnonymous) ); const currentDate = new Date(); diff --git a/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html b/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html index 1e67afe742..a1eb2990b7 100644 --- a/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html +++ b/client/src/app/site/pages/organization/pages/orga-meetings/pages/meeting-list/components/meeting-list/meeting-list.component.html @@ -70,12 +70,7 @@

{{ 'Meetings' | translate }}

star @@ -181,7 +176,7 @@

{{ 'Meetings' | translate }}