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

Hanko - Permit grammar and formatting fixes #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/integrations/authentication/hankopermit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ you'll find four functions, `GET`, `POST`, `PUT`, and `DELETE` - responsible for
respectively.

If you look at the `route.ts` file, you will see that we are going to use a generic
[`permit.check`](/how-to/enforce-permissions/check/) [middleware.ts](https://github.com/permitio/permit-hanko/blob/main/src/middleware.ts)
[`permit.check`](/how-to/enforce-permissions/check/) function in the [middleware.ts](https://github.com/permitio/permit-hanko/blob/main/src/middleware.ts)
file.

```
Expand Down Expand Up @@ -178,7 +178,7 @@ Setting up Permit will fix this.
:::

Now, we must configure these permissions in Permit.
Not that we can adapt them to our needs without having to change any of the application code!
Note that we can adapt them to our needs without having to change any of the application code!

Let's begin by setting everything up within the Permit Dashboard:

Expand All @@ -199,7 +199,11 @@ Let's begin by setting everything up within the Permit Dashboard:

Next, we need to place the Permit.io API credentials in our application config.

1. To use Permit in your application, you get the API key from Permit dashboard.
1. Get your API key from the Permit dashboard, and add it to the `env.local` file.

:::note
To copy your API key, click your user profile in the top right of the screen, and click `Copy SDK API Key`.
:::

2. Add the key in your in the `env.local` file:

Expand Down Expand Up @@ -269,8 +273,10 @@ Now that we are done with the Role Based model in our application let's go to th

## Add Fine-Grained Attribute-Based Authorization

Note: For this section to run properly, you need to run the Permit.io PDP as a sidecar,
:::note
For this section to run properly, you need to run the Permit.io PDP as a sidecar,
[You can read how to do that here](https://docs.permit.io/how-to/deploy/deploy-to-production).
:::

As stated before, the delete action in our app is supposed to be limited to the same user who created the role.
This is a more complex policy that cannot be defined by using simple roles - it needs attributes as well.
Expand Down