# Policies

"Policies" in our accelerator product refers to the predefined rules and guidelines that govern the behavior and access control of users, objects, and resources within the system. These policies define the permissions, restrictions, and conditions that determine how users can interact with the platform and its components.

## Policies Data Model

<table><thead><tr><th width="234.33333333333331">Name</th><th width="167">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>_id</td><td>ObjectId</td><td>System-generated unique identifier assigned to each role.</td></tr><tr><td>_createdAt</td><td>Date</td><td>System-generated timestamp that denotes the date and time when a policy was created.</td></tr><tr><td>_createdBy</td><td>String</td><td>System-generated field that indicates the account who created.</td></tr><tr><td>_modifiedAt</td><td>Date</td><td>System-generated generated timestamp that denotes the date and time when a policy was modified.</td></tr><tr><td>_modifiedBy</td><td>String</td><td>System-generated field that indicates the account who modified.</td></tr><tr><td>name</td><td>String</td><td>Represents the name of the policy in the system.</td></tr><tr><td>label</td><td>String</td><td>Represents the label of the policy in the system.</td></tr><tr><td>description</td><td>String</td><td>Represents the description of the policy in the system.</td></tr><tr><td>version</td><td>String</td><td>Represents the version of the policy in the system.</td></tr><tr><td>type</td><td>String</td><td>Represents the type of the policy in the system. Currently we have a "ObjectControl" type in the system.</td></tr><tr><td>org</td><td>String</td><td>Represents the organization associated with the policy in the system.</td></tr><tr><td>object</td><td>String</td><td>Represents the role/object associated with the policy in the system.</td></tr><tr><td>fields</td><td>ObjectArray</td><td>Represents the definition of all the columns associated with the policy in the system.</td></tr><tr><td>fields.read</td><td>Array</td><td>Represents the list of readable columns associated with the policy in the system.</td></tr><tr><td>fields.write</td><td>Array</td><td>Represents the list of writeable columns associated with the policy in the system.</td></tr><tr><td>condition</td><td>Object</td><td>Represents the list conditions associated with the policy in the system.</td></tr><tr><td>condition.stringEquals</td><td>Object</td><td>Represents the condition which will be applied to the policy in the system.</td></tr></tbody></table>

## Example Policies

```json
{
    "_id":
        {
            "$oid":"64392c1d862be321e3598f63"
        },
    "_createdAt":
        {
            "$date":
                {
                    "$numberLong":"1681468445347"
                }
        },
    "_createdBy":"john@email.com",
    "_modifiedAt":
        {
            "$date":
                {
                    "$numberLong":"1681468445347"
                }
        },
    "_modifiedBy":"john@email.com",
    "name":"providerDataAccess",
    "label":"Provider Data Access",
    "description":null,
    "version":"2023-01",
    "type":"ObjectControl",
    "org":"64392b37862be321e3598f58",
    "object":"Providers",
    "fields":
        {
            "read":"*",
            "write":
                [
                    "name",
                    "email"
                ]
        },
    "condition":
        {
            "stringEquals":
                {
                    "email":"{{user.email}}"
                }
        }
}
```

{% openapi src="/files/1Zvo9GVhuSXznVDAJt9t" path="/api/v1/CreatePolicy" method="post" %}
[User\_APIs.json](https://1738158455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCVrtNgJZsfJ0IDZkXa1%2Fuploads%2FNC5TClB7wr0JsePCc7Gu%2FUser_APIs.json?alt=media\&token=9aca0938-9a30-499f-8a52-0225fe22a66b)
{% endopenapi %}

{% openapi src="/files/1Zvo9GVhuSXznVDAJt9t" path="/api/v1/GetPolicies" method="get" %}
[User\_APIs.json](https://1738158455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCVrtNgJZsfJ0IDZkXa1%2Fuploads%2FNC5TClB7wr0JsePCc7Gu%2FUser_APIs.json?alt=media\&token=9aca0938-9a30-499f-8a52-0225fe22a66b)
{% endopenapi %}

{% openapi src="/files/1Zvo9GVhuSXznVDAJt9t" path="/api/v1/GetPolicy/{id}" method="get" %}
[User\_APIs.json](https://1738158455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCVrtNgJZsfJ0IDZkXa1%2Fuploads%2FNC5TClB7wr0JsePCc7Gu%2FUser_APIs.json?alt=media\&token=9aca0938-9a30-499f-8a52-0225fe22a66b)
{% endopenapi %}


---

# 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://docs.accelerator-platform.com/core-api-reference/policies.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.
