Skip to main content

Approval Management

Embed the Approval Management element so reviewers can approve or deny operation approval requests inside your application. This page is for developers who add Permit Elements, the embeddable UI components, to an application that already uses the Operation Approval element.

Approval Management element listing pending requests with Approve and Deny buttons

How approval management works

The Approval Management element lists the requests that users submit through an Operation Approval element.

  1. When you create an Operation Approval element, Permit creates two roles on its resource: _Reviewer_ and _Approved_.
  2. Users who hold the _Reviewer_ role on a request's resource instance see that request in the Approval Management element.
  3. A reviewer approves or denies the request.
  4. When a reviewer approves a request, Permit assigns the requesting user the _Approved_ role on the request's resource instance.

For example, an employee in the marketing department wants to transfer money to an advertising supplier. The employee can't make the transfer without approval, so the employee requests it through the Operation Approval element. The marketing manager approves the transfer in the Approval Management element.

Operation approval flow: an employee requests approval for a bank transfer, a reviewer approves or denies the request in the Approval Management element

Prerequisites

Create the element

1. Start a new Approval Management element

In the Elements screen, under Approval Management, click Create Element.

Elements screen with the Create Element button under Approval Management

2. Name the element

Enter a name for the element, and click Create.

Approval Management element form before creation

Customize the element

In the element form, you can:

  • Change the background color and the button colors
  • Show or hide the requesting user's email, the request reason, and the request date and time

Approval Management element form with color and display settings

Add the iframe to your application

  1. Open the Approval Management element, and click Generate Code at the top of the screen.

    Approval Management element page with the Generate Code button

  2. Copy the iframe snippet, and paste it into the page where reviewers work.

  3. Replace the placeholders in src with your values.

Placeholders in the iframe src

PlaceholderValue
<ELEMENT_NAME>The name of the element you created.
<SOME_UNIQUE_ID>The ID of your environment.
<iframe
title="Permit Element Name"
src="https://embed.permit.io/<ELEMENT_NAME>?envId=<SOME_UNIQUE_ID>&darkMode=false"
width="100%"
height="100%"
style="border: none;"
/>

This example has no tenantKey parameter. If the snippet that Generate Code produces includes tenantKey, set it to the key of the tenant the element applies to.

Log users in to the element

Before the iframe loads, log the reviewer in to Permit Elements with permit.elements.login(). For the steps, see Embed Permit Elements. For all login methods, see Log users in to Permit Elements.

Verify the element

  1. Submit a request through the Operation Approval element, and assign a reviewer to the request's resource instance.
  2. Sign in to your application as the reviewer, and open the page with the Approval Management element. The request appears in the list.
  3. Click Approve. In the Permit dashboard, open Directory. The requesting user has the _Approved_ role on the resource instance.

Next steps