https://cerbos.dev logo
#help
Title
# help
m

Maggie Walker

02/02/2023, 7:14 PM
Just want to confirm that Resources need to be uniquely named, yes? And if there is a case where, let's say two different business realms have a concept of a
contract
, would the best thing be to just specify
accounting_contract
as one resource and
label_contract
as another?
c

Charith (Cerbos)

02/02/2023, 7:22 PM
Yes, resource names have to be unique and adding a prefix to the name is certainly the easiest way to do it. Another (slightly harder) way is to keep the resource name as
contract
but change the
version
to
accounting
or
label
or so on. The downside to that is that you need to remember to use the correct
version
in all your API requests.
Uniqueness is checked based on the combination of kind, name, version and scope of each policy. You can't have two policy files that have the same values for those four fields.
m

Maggie Walker

02/02/2023, 7:40 PM
thanks for clarifying!
@Charith (Cerbos) what is the difference between kind and name?
c

Charith (Cerbos)

02/03/2023, 4:52 PM
Oh, by
kind
I meant the policy kind (resource, principal, derived role). You can't really change that.
m

Maggie Walker

02/03/2023, 4:52 PM
ahhh got it
c

Charith (Cerbos)

02/03/2023, 4:52 PM
Sorry, I should have made that clearer
m

Maggie Walker

02/03/2023, 4:53 PM
all good!
4 Views