#Directly reference Subject in Entity

1 messages · Page 1 of 1 (latest)

viral dust
#

This is my current schema

entity user {
    attribute is_superuser boolean
}

entity brand {

    // organizational roles
    relation admin @user
    relation manager @user
    relation member @user

    permission create_ship = admin
}

entity ship {

    // represents repositories parent organization
    relation parent @brand

    // represents owner of this repository
    relation captain  @user
    relation engineer @user

    // permissions
    permission cud   = user.is_superuser or parent.admin or captain
}

I want users to have a superuser flag which when set to true leverage them to a root state where they can do basically anything. there for I need to check it for every permission.
Is there a way I can reference the subject of the request and ensure its a user so I can check if its the superuser

Or is there another approach to define a root user?

#

Directly reference Subject in Entity