# Permissions

Often times, commands will be limited to only staff members or people with certain authorisation or access. This is where permissions come in. Permissions will stop a command and send a message to executors if they do not have a required permission node.

Adding permissions to a command uses two properties:\
`permission:` and `permission message:`

After the `permission:` property, a permission node must be specified. After the `permission message:` property, input a message. If no message is inputted, will use the default permission message.

Example:

{% code overflow="wrap" lineNumbers="true" %}

```python
#: Poorly-written command
command ban <target:player> <duration:timespan> <reason:string>:
  trigger:
    if executor has permission "staff.ban":
      ban {_target} due to {_reason} for {_duration}
    else:
      send "You are not allowed to ban players!" to executor
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```python
#: Well-written command
command muteChat:
  permission: staff.mutecbanhat
  permission message: You are not allowed to ban players!
  trigger:
    ban {_target} due to {_reason} for {_duration}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://x8ight.gitbook.io/syntask/fundamentals/structures/commands/permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
