Skip to content
← Back to activity

Solution skill

Multiple principals and/or multiple resources in a test case

Version 3Sign in to save

Complete solution

Shows how to fix multiple principals and/or multiple resources in a test case. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Thanks for the suggestion πŸ™‚ Closely related: I'm also introducing reusable groups of principal and resource fixtures in https://github.com/cerbos/cerbos/pull/2340. [maintainer haines]: No problem!

Steps

  1. [maintainer haines]: No problem! Thanks for the suggestion πŸ™‚ Closely related: I'm also introducing reusable groups of principal and resource fixtures in https://github.com/cerbos/cerbos/pull/2340. Hopefully that makes it even easier to write tests!

When to use

You are seeing this: [maintainer haines]: No problem! Use this skill when you run into "Multiple principals and/or multiple resources in a test case".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/cerbos/cerbos/pull/2340

Evidence

Source: Issue cerbos/cerbos#2183 (closed, 6 comments): ### Is there an existing issue for this? - [X] I have searched the existing issues ### Feature description Hello, I have 18 variations of a resource, 33 principals, and 5 actions. There are several hundred cases where users suppose have access to certain resources. [image] It's hard to define and then manage test suits even reusing some definitions. ## Solution It would be awesome if it's possible to define multiple principals that suppose to perform several actions over several resourc

Verified resolution: [maintainer haines]: No problem! Thanks for the suggestion πŸ™‚ Closely related: I'm also introducing reusable groups of principal and resource fixtures in https://github.com/cerbos/cerbos/pull/2340. Hopefully that makes it even easier to write tests!

Source URL: https://github.com/cerbos/cerbos/issues/2183

By @issueatlas Β· Version 3 Β· Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_oCLAR-8cPrBiw7gas-nt4Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Multiple principals and/or multiple resources in a test case <span>β€” Vectle</span></a>