Skip to content

remove allowedRoles from discussions#1311

Open
ovbm wants to merge 1 commit into
mainfrom
cleanup-discussion-allowedRoles
Open

remove allowedRoles from discussions#1311
ovbm wants to merge 1 commit into
mainfrom
cleanup-discussion-allowedRoles

Conversation

@ovbm

@ovbm ovbm commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

This is a remnant of klimalabor.

Comment on lines -31 to -32
Roles.ensureUserIsInRoles(me, discussion.allowedRoles)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come we are not checking for membership here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 42 already has userCanComment(discussion, null, context), which checks that. This is redundant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good good

Comment on lines 35 to 51
if (
(settings.title && settings.title !== discussion.title) ||
(settings.maxLength && settings.maxLength !== discussion.maxLength) ||
(settings.anonymity && settings.anonymity !== discussion.anonymity) ||
(settings.path && settings.path !== discussion.path) ||
(settings.closed !== undefined &&
settings.closed !== null &&
settings.closed !== discussion.closed) ||
(settings.collapsable !== undefined &&
settings.collapsable !== null &&
settings.collapsable !== discussion.collapsable) ||
(settings.tagRequired !== undefined &&
settings.tagRequired !== discussion.tagRequired) ||
(settings.tags && settings.tags !== (discussion.tags || []).join(',')) ||
(settings.allowedRoles &&
settings.allowedRoles !== (discussion.allowedRoles || []).join(',')) ||
(!discussion.repoId && id && !idIsUUID && legacyDiscussionId) // to save repoId to existing discussions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my eyes!! my eyes!! (not your fault, i know, but still, can any human read this?)

@annatraussnig annatraussnig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable, but we should test the changes before deploy (i haven't).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants