---
title: "assign_access_policy"
description: "Select and assign access policies easily with our Access Policy Picker pop-up modal for seamless user integration. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/developers/ui-dev/actions/assign_access_policy"
---

# assign\_access\_policy

ID: `assign_access_policy`

Brings up a popup modal that lets the user select an access policy using an Access Policy Picker. The selected access policy is handed back on the callback.

## Sample Code

```
var UI = require("ui");

var actionContext = {};
actionContext.ref = node.ref(); // "node://platformId/repositoryId/branchId/nodeId";
UI.startAction(observableHolder, "assign_access_policy", actionContext, function(err) {

    // if something went wrong, err will contain the error
    // otherwise, success

});
```

## Configuration

The sample code sets the following `actionContext` keys:

| Key | Type | Description |
| --- | --- | --- |
| `ref` | string | A reference, set from `node.ref()` in the sample (for example, `"node://platformId/repositoryId/branchId/nodeId"`) |
