Skip to content

test: require the permission refusal in the restricted-admin apply check - #118

Merged
somethingwithproof merged 3 commits into
mainfrom
fix/permissions-e2e-restricted-apply
Nov 20, 2026
Merged

somethingwithproof merged 3 commits into
mainfrom
fix/permissions-e2e-restricted-apply

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #115

Intent: the restricted user's config and import apply checks only asserted that nothing was written. The page rejects a placeholder or stale plan id whether or not the permission check runs, so they proved nothing about the permission. #115 fixed this for nodisabled.

Changed (tests/permissions-e2e.sh only): the apply response for restricted must contain "do not cover every device", for the config apply and the import apply; the no-write assertions are separate checks. imp_apply now keeps the response body in $WORK/imp-apply.out instead of discarding it; existing callers are unchanged.

Verification: the permissions e2e job passes on both Cacti versions. Locally, the suite passes on main's code; with the permission refusal disabled in an uncommitted patch, config-apply-refused-restricted-admin and import-apply-refused-restricted-admin FAIL while the no-write checks still pass.

Risk: test-only.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4c1ac97d-0273-402d-8270-0e8828405108
Commits

Reviewing files that changed from the base of the PR and between ab546ae and b9d896c.

Files selected for processing: 1

  • tests/permissions-e2e.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@gitar-bot

gitar-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

Follow-up to #115. The apply check for the existing `restricted` user only
asserted that nothing was written. The placeholder plan id is rejected by
the page whether or not the permission check runs, so the check passed
without exercising it. #115 fixed the same weakness for `nodisabled` by also
requiring the refusal text.

Now the apply response must contain "do not cover every device" for
`restricted` too, and the no-write assertion is a separate check.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…pply check

imp_apply discarded the response, so the restricted import apply was only
checked for writing nothing, which a stale plan id also satisfies. It now
keeps the body in $WORK/imp-apply.out (callers are unchanged) and the
restricted apply must contain "do not cover every device"; the no-write
check stays separate.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof
somethingwithproof force-pushed the fix/permissions-e2e-restricted-apply branch from b2a52e5 to b9d896c Compare November 20, 2026 09:19
@sonarqubecloud

Copy link
Copy Markdown

@somethingwithproof
somethingwithproof merged commit ad7ee20 into main Nov 20, 2026
42 checks passed
@somethingwithproof
somethingwithproof deleted the fix/permissions-e2e-restricted-apply branch November 20, 2026 09:30
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.

1 participant