permify icon indicating copy to clipboard operation
permify copied to clipboard

Refinement of Schema Files: Integrating Scenario-Specific Relationships and Attributes

Open tolgaOzen opened this issue 1 year ago • 16 comments

Description

To improve our schema file structure for testing various user, company, organization, and team scenarios, we propose an enhancement that allows for scenario-specific definitions of relationships and attributes, while retaining the global definitions. This approach aims to provide both flexibility and efficiency in our testing process.

Current Schema Structure

Our schema file currently includes global definitions for entities, relationships, attributes, and scenarios. For example:

schema: |-
    entity user {}
    entity role {
        relation assignee @user
    }
    // ... other entities and relations ...

relationships:
    - dashboard:project-progress#view@role:admin#assignee
    // ... other global relationships ...

attributes:
    // ... global attributes ...

scenarios:
    - name: "User Dashboard View Permissions"
      // ... scenario details ...
    // ... other scenarios ...

Proposed Enhancement

Retain Global Definitions: Keep the global definitions of relationships and attributes as they are for overarching applicability. Introduce Scenario-Specific Definitions: Allow for defining relationships and attributes within individual scenarios for more specific and contextual testing.

Example of Proposed Structure

scenarios:
  - name: "User Dashboard View Permissions for project-progress"
    description: "Verifies if user:1 has view access to the 'project-progress' dashboard."
    relationships:
      - dashboard:project-progress#view@role:admin#assignee
      - dashboard:project-progress#view@role:member#assignee
      // ... scenario-specific relationships ...
    attributes:
      // ... scenario-specific attributes ...
    checks:
      - entity: dashboard:project-progress
        subject: user:1
        assertions:
          view: true
  // ... other scenarios ...

Goals

Dual Flexibility: Maintain the efficiency of global definitions while providing the flexibility of scenario-specific configurations. Clarity and Specificity: Enhance clarity in complex scenarios by allowing specific relationship and attribute definitions. Streamlined Testing: Facilitate more focused and accurate scenario testing.

Action Items

  • Assess the current schema file structure and identify areas for integration of scenario-specific definitions.
  • Develop a prototype schema incorporating these changes.
  • Test and validate the effectiveness of the new schema structure.
  • Update documentation to guide the use of both global and scenario-specific definitions.

tolgaOzen avatar Nov 14 '23 12:11 tolgaOzen

/bounty $200

tolgaOzen avatar Nov 14 '23 13:11 tolgaOzen

💎 $200 bounty • Permify.co

Steps to solve:

  1. Start working: Comment /attempt #838 with your implementation plan
  2. Submit work: Create a pull request including /claim #838 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Don't wait to be assigned. A reward will be given for the best PR.

Thank you for contributing to Permify/permify!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @scshiv29-dev Nov 14, 2023, 2:18:21 PM WIP
🟢 @akhill10 Nov 14, 2023, 7:59:18 PM WIP
🔴 @saifxd7 Nov 15, 2023, 7:21:31 AM WIP
🟢 @aazam-gh #1113

algora-pbc[bot] avatar Nov 14 '23 13:11 algora-pbc[bot]

/attempt #838

Options

scshiv29-dev avatar Nov 14 '23 14:11 scshiv29-dev

As @scshiv29-dev canceled his attempt.

I want to take this up. @scshiv29-dev let me know if you're still working on it

/attempt #838

Options

akhill10 avatar Nov 14 '23 19:11 akhill10

/attempt #838

Options

saifxd7 avatar Nov 15 '23 07:11 saifxd7

Note: The user @akhill10 is already attempting to complete issue #838 and claim the bounty. If you attempt to complete the same issue, there is a chance that @akhill10 will complete the issue first, and be awarded the bounty. We recommend discussing with @akhill10 and potentially collaborating on the same solution versus creating an alternate solution.

algora-pbc[bot] avatar Nov 15 '23 07:11 algora-pbc[bot]

Hi @akhill10, I'm assigning this issue to you since @scshiv29-dev cancelled his attempt. Happy hacking ✌🏻

EgeAytin avatar Nov 15 '23 07:11 EgeAytin

/attempt #838

saifxd7 avatar Nov 21 '23 10:11 saifxd7

@EgeAytin is this still open?

melsonic avatar Nov 25 '23 17:11 melsonic

@EgeAytin May I work on this issue? If not working anyone.

saifxd7 avatar Jan 23 '24 08:01 saifxd7

Hi @akhill10, is there any progress on this ?

EgeAytin avatar Jan 25 '24 19:01 EgeAytin

I'm unassigning @akhill10 due to inactivity. @melsonic , if you are still interested in contributing, I can assign the task to you.

EgeAytin avatar Feb 07 '24 13:02 EgeAytin

Sure

melsonic avatar Feb 08 '24 00:02 melsonic

Adding my name in queue.

mohanish2504 avatar Feb 08 '24 07:02 mohanish2504

💡 @aazam-gh submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Mar 12 '24 11:03 algora-pbc[bot]