{"id":16413150,"url":"https://github.com/groguelon/permify","last_synced_at":"2025-03-23T06:31:17.204Z","repository":{"id":61208074,"uuid":"549282856","full_name":"GRoguelon/permify","owner":"GRoguelon","description":"An Elixir client for the project Permify.","archived":false,"fork":false,"pushed_at":"2022-10-11T01:18:54.000Z","size":18,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-14T15:12:45.197Z","etag":null,"topics":["authorization","elixir","permify"],"latest_commit_sha":null,"homepage":"https://www.permify.co/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GRoguelon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-11T00:33:20.000Z","updated_at":"2023-12-18T15:47:51.000Z","dependencies_parsed_at":"2022-10-12T18:59:42.856Z","dependency_job_id":null,"html_url":"https://github.com/GRoguelon/permify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GRoguelon%2Fpermify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GRoguelon%2Fpermify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GRoguelon%2Fpermify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GRoguelon%2Fpermify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GRoguelon","download_url":"https://codeload.github.com/GRoguelon/permify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245066496,"owners_count":20555402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authorization","elixir","permify"],"created_at":"2024-10-11T06:50:44.652Z","updated_at":"2025-03-23T06:31:15.835Z","avatar_url":"https://github.com/GRoguelon.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Permify\n\nPermify is an Elixir client for the project [permify](https://www.permify.co/).\n\n[Documentation](https://hexdocs.pm/permify)\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:permify, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Usage\n\n### Create a new client\n\n```elixir\nclient = Permify.Client.new(\"http://localhost:3476/v1\")\n```\n\n### Create a schema\n\n```elixir\nschema = \"\"\"\nentity user {}\n\nentity organization {\n    relation admin @user\n    relation member @user\n\n    action view_files = admin or member\n    action edit_files = admin\n}\n\"\"\"\n\n{:ok, schema_version} = Permify.Schema.write(client, schema)\n```\n\n### Create some relationships\n\n```elixir\nrelationship = %{\n  entity: %{id: \"1\", type: \"organization\"},\n  relation: \"member\",\n  subject: %{id: \"1\", type: \"user\"},\n  schema_version: schema_version\n}\n\nPermify.Relationship.write(client, relationship)\n```\n\n### Check permissions\n\n```elixir\n{:ok, %{\"can\" =\u003e can}} = Permify.Permission.check?(client, %{\n  action: \"edit_files\",\n  depth: 0,\n  entity: %{type: \"organization\", id: \"1\"},\n  subject: %{id: \"1\", type: \"user\"}\n})\n\nIO.inspect(can, label: \"Is authorized\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroguelon%2Fpermify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroguelon%2Fpermify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroguelon%2Fpermify/lists"}