Skip to content

Commit

Permalink
Remove presence stuff, hide amendment button
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom committed Apr 10, 2024
1 parent 229c80e commit 185b2a8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ export class MotionPermissionService {
return false;
}
return (
this.operator.hasPerms(Permission.motionCanCreateAmendments) &&
this.operator.hasPerms(
this.operator.isAllowedWithDelegation(`users_forbid_delegator_as_submitter`)
? Permission.motionCanCreateAmendments
: Permission.motionCanManage
) &&
this._amendmentEnabled &&
(!motion.lead_motion_id || (!!motion.lead_motion_id && this._amendmentOfAmendmentEnabled))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,23 +912,23 @@ export const meetingSettings: SettingsGroup[] = fillInSettingsDefaults([
key: `users_forbid_delegator_in_list_of_speakers`,
label: _(`Restrict delegation principals from adding themselves to the list of speakers.`),
helpText: _(
`Enabling this will cause non-present participants, whose voting rights have been delegated, to be unable to add themselves to any list of speakers unless they have managing rights.`
`Enabling this will cause participants, whose voting rights have been delegated, to be unable to add themselves to any list of speakers unless they have managing rights.`
),
type: `boolean`
},
{
key: `users_forbid_delegator_as_submitter`,
label: _(`Restrict delegation principals from creating motions.`),
helpText: _(
`Enabling this will cause non-present participants, whose voting rights have been delegated, to be unable to create motions unless they have managing rights.`
`Enabling this will cause participants, whose voting rights have been delegated, to be unable to create motions unless they have managing rights.`
),
type: `boolean`
},
{
key: `users_forbid_delegator_as_supporter`,
label: _(`Restrict delegation principals from supporting motions.`),
helpText: _(
`Enabling this will cause non-present participants, whose voting rights have been delegated, to be unable to support motions unless they have managing rights.`
`Enabling this will cause participants, whose voting rights have been delegated, to be unable to support motions unless they have managing rights.`
),
type: `boolean`
}
Expand Down
1 change: 0 additions & 1 deletion client/src/app/site/services/operator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ export class OperatorService {

public isAllowedWithDelegation(...appliedSettings: DelegationSetting[]): boolean {
return (
this.user.isPresentInMeeting(this.activeMeetingId) ||
!this.user.getMeetingUser(this.activeMeetingId)?.vote_delegated_to_id ||
!appliedSettings.some(appliedSetting => this.meetingSettings.instant(appliedSetting as keyof Settings))
);
Expand Down
2 changes: 0 additions & 2 deletions client/src/app/ui/directives/perms/perms.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,11 @@ export class PermsDirective extends BasePermsDirective<Permission> implements On
* Returns true if the users permissions fit.
*/
protected hasPermissions(): boolean {
console.log(`HAS PERM`, this.permissions);
let permissions = this.permissions;
if (
this._delegationSettingAlternative &&
!this.operator.isAllowedWithDelegation(this._delegationSettingAlternative[0])
) {
console.log(`->`, this._delegationSettingAlternative[1]);
permissions = [this._delegationSettingAlternative[1]];
}
return this.operator.hasPerms(...permissions);
Expand Down

0 comments on commit 185b2a8

Please sign in to comment.