Skip to content

previous resource in policy file doesn't work #1656

Answered by haines
9m-pwn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @9m-pwn, you need to create two separate YAML files (e.g. project.yaml and user.yaml) instead of putting them together in the same file.

user.yaml

apiVersion: api.cerbos.dev/v1
resourcePolicy:
  version: default
  resource: user
  rules:
    - actions:
        - "*"
      effect: EFFECT_ALLOW
      roles:
        - admin
        - super_user
    - actions:
        - read
      effect: EFFECT_ALLOW
      roles:
        - user
        - guest

project.yaml

apiVersion: api.cerbos.dev/v1
resourcePolicy:
  version: default
  resource: project
  rules:
    - actions:
        - "*"
      effect: EFFECT_ALLOW
      roles:
        - super_user
    - actions:
        - read
      effect: EFFECT_A…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by haines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants