#How to check subject and object id or

1 messages · Page 1 of 1 (latest)

gusty trench
#

I think, I need to clarify a few points before I can provide an accurate answer.

In Permify's schema language, comparing attributes or IDs of subjects and objects directly in action definitions is not supported in the way you've written it.

For attribute-based checks, Permify uses rules and attributes. You would define an attribute for the entity and then use a rule to check it.

For relationship-based checks, you would define relations between entities.

Here's an example of how you might structure this

entity user {
    relation admin @user
    relation self  @user
    
    action change_password = admin or self
}

To use this, you would need to create the appropriate relationship tuples. For example:

user:1#self@user:1
user:1#admin@user:1

Or different approach would be:

entity user {}

entity organization {
    relation admin @user
}

entity account {
    relation owner @user
    relation org @organization
    
    action change_password = owner or org.admin
}