> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HasPermission

> HasPermission method in the ABBYY FlexiCapture web services API checks whether a user or group holds a given role in a project and returns true or false.

## What it does

Checks whether a user or a group has the permission to use the specified role in the specified project.

## Definition

```
bool HasPermission( int principalId, int projectId, int batchTypeId, int roleType );
```

## Parameters

<table width="100%"><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Type</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p>principalId</p></td><td><p>int</p></td><td><p>User or group ID</p></td></tr><tr><td><p>projectId</p></td><td><p>int</p></td><td><p>Project ID</p><ul><li>-1 - all projects</li></ul></td></tr><tr><td><p>batchTypeId</p></td><td><p>int</p></td><td><p>Batch ID</p><ul><li>-1 - all batch types</li><li>0 - batch by default</li></ul></td></tr><tr><td><p>roleType</p></td><td><p>int</p></td><td><p>User role type.<br />For possible values, see <a href="/flexi-capture/reports/database/role-type-enum">User role types</a>.</p></td></tr></tbody></table>

## Returned value

<table width="100%"><tbody><tr><td><p><strong>Type</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p>bool</p></td><td><ul><li>"true" if the permission was granted</li><li>otherwise "false" is returned</li></ul></td></tr></tbody></table>
