Skip to content

Lookup-entity filter by relations #2249

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

Open
Disimasa opened this issue May 27, 2025 · 0 comments
Open

Lookup-entity filter by relations #2249

Disimasa opened this issue May 27, 2025 · 0 comments
Assignees
Labels
feature request New feature or request

Comments

@Disimasa
Copy link

Is your feature request related to a problem? Please describe.
I use Lookup entity to get permitted ids and pass them to sql query for data selection. It works for simple entities, however sometimes I need to pass additional filter by relation or attribure.

Describe the solution you'd like

For example I have such permify schema on my project:

entity member {}
entity team {
  relation member @member
}
entity project {
  relation team @team
  relation member @member @team#member

  action teamMember = team.member
}
entity connection {
  relation project @project
  relation owner @member @team#member

  attribute projectAccess boolean
  attribute teamAccess boolean

  action read = owner or (projectAccess and project.member) or (teamAccess and project.teamMember)
}

I'd like to get a list of connection ids which have read action in current project by current member. However in lookup entity I can pass only subjectId, so I get list of readable connections for member without filtration by projectId. It'd be greate to add a field to request body like that:

{
	entity_type: "connection",
	permission: "read",
	subject: {
	  type: "member",
	  id: "memberId"
	},
	filters: [
	  {
	    type: "project",
	    id: "projectId"
	  }
	]
}
@Disimasa Disimasa added the feature request New feature or request label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants