Skip to content

Fix website manager ability check on permalinks - #4262

Closed
SAY-5 wants to merge 2 commits into
osunyorg:mainfrom
SAY-5:fix-permalink-website-manager-ability
Closed

SAY-5 wants to merge 2 commits into
osunyorg:mainfrom
SAY-5:fix-permalink-website-manager-ability

Conversation

@SAY-5

@SAY-5 SAY-5 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Type

  • Nouvelle fonctionnalité
  • Bug
  • Ajustement
  • Rangement

Description

Fixes #4222.

Ability::WebsiteManager grants Communication::Website::Permalink access with the condition communication_website_id: managed_websites_ids, but the model's actual foreign key column is website_id (as used a few lines above for Communication::Website::Menu::Item). CanCanCan calls permalink.communication_website_id when checking the instance-level ability, which raises NoMethodError: undefined method 'communication_website_id' for any website manager creating or updating a permalink.

Added a model test creating a website manager scoped to a website and asserting they can manage a permalink on it. It needs the full Rails/Postgres test harness to run, which I could not stand up locally, but it mirrors the existing permalink_test.rb cases.

Niveau d'incidence

  • Incidence faible 😌
  • Incidence moyenne 😲
  • Incidence forte 😱

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@arnaudlevy

Copy link
Copy Markdown
Member

Thanks @SAY-5! @pabois, seems like you already integrate that in the code? Did you communicate with @SAY-5?

@pabois

pabois commented Sep 25, 2026

Copy link
Copy Markdown
Member

Yes, we had a problem on the foreign key catched by bugsnag, I already fixed that in the codebase.

@pabois

pabois commented Sep 25, 2026

Copy link
Copy Markdown
Member

I close this PR.
Thanks @SAY-5

@pabois pabois closed this Sep 25, 2026
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.

NoMethodError in admin/communication/websites/permalinks#create

3 participants