Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tolgaOzen opened this issue Nov 14, 2023 · 16 comments · May be fixed by #1113 or #862
Open

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

tolgaOzen opened this issue Nov 14, 2023 · 16 comments · May be fixed by #1113 or #862
Labels
area/schema Issues related with modeling and schema. 💎 Bounty go Pull requests that update Go code validation-command

Comments

@tolgaOzen
Copy link
Member

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 tolgaOzen added area/schema Issues related with modeling and schema. go Pull requests that update Go code 💎 Bounty validation-command labels Nov 14, 2023
@tolgaOzen
Copy link
Member Author

/bounty $200

Copy link

algora-pbc bot commented Nov 14, 2023

💎 $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

@scshiv29-dev
Copy link

scshiv29-dev commented Nov 14, 2023

/attempt #838

Options

@akhill10
Copy link

akhill10 commented Nov 14, 2023

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

@saifxd7
Copy link
Contributor

saifxd7 commented Nov 15, 2023

/attempt #838

Options

Copy link

algora-pbc bot commented Nov 15, 2023

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.

@EgeAytin
Copy link
Member

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

@EgeAytin EgeAytin assigned akhill10 and unassigned scshiv29-dev Nov 15, 2023
@saifxd7
Copy link
Contributor

saifxd7 commented Nov 21, 2023

/attempt #838

@melsonic
Copy link

@EgeAytin is this still open?

@saifxd7
Copy link
Contributor

saifxd7 commented Jan 23, 2024

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

@EgeAytin
Copy link
Member

Hi @akhill10, is there any progress on this ?

@EgeAytin
Copy link
Member

EgeAytin commented Feb 7, 2024

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

@melsonic
Copy link

melsonic commented Feb 8, 2024

Sure

@mohanish2504
Copy link
Contributor

Adding my name in queue.

Copy link

algora-pbc bot commented Mar 12, 2024

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

@vikashsprem
Copy link

vikashsprem commented Aug 24, 2024

@EgeAytin , this issue has been pending for a long time. Should I work on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Issues related with modeling and schema. 💎 Bounty go Pull requests that update Go code validation-command
Projects
Status: Q1 2024 – Jan-Mar
8 participants