---
title: "userHasSpacePermission routine"
canonical: "https://support.appfire.com/space/PSCONF/15303887/userHasSpacePermission%20routine"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | userHasSpacePermission(permissionType, spaceKey, userNameOrKey) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Checks if a user has the specified space permission.

Checks if a user has the specified space permission.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | permissionType | String | Yes | Permission type to check. A list of values is provided below. |
> | spaceKey | String | Yes | The key of the space to check permission for. |
> | userNameOrKey | String | Yes | The name of a user to check permission for. |

## Return Type

**Boolean (true/false)**

## Example

Checks if user "jdoe" is allowed to edit space with key "PS-DOCS".

```javascript
userHasSpacePermission("EDITSPACE", "PS-DOCS", "jdoe");
```

## See also

> Macro (contentbylabel)