permify icon indicating copy to clipboard operation
permify copied to clipboard

Optional Nil Actions and Permissions in Entity Definitions

Open tolgaOzen opened this issue 1 year ago • 1 comments

Objective

Introduce the capability for actions and permissions within entity definitions to be optionally set to nil. This feature aims to enhance flexibility in permission management across different entities in our system.

Concept

  • Entities can have them set to nil.
  • This approach allows for dynamic and contextual assignment of capabilities depending on the entity's role or specific requirements.

Examples

entity user{
   action view = nil
   action contribute = nil
   action maintain = nil
   action manage = nil
}

entity product {
   relation parent @company @organization @team @user

   action view = parent.view
   action contribute = parent.contribute
   action maintain = parent.maintain
   action manage = parent.manage
}

In this example, if a user is assigned as the parent of a product, they should be able to perform these permissions.

Implementation

The implementation would require changes to the entity definition structure to accept nil as a valid value for actions/permissions.

tolgaOzen avatar Nov 28 '23 07:11 tolgaOzen

Hi @tolgaOzen , I would like to work on this issue. Can you assign to me?

saifxd7 avatar Dec 09 '23 19:12 saifxd7