# How to apply role to user?

**URL:** <https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767>\
**Category:** Users & Roles\
**Created:** [April 7, 2017, 7:08pm UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767 "2017-04-07T19:08:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![w.k](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/w.k/32/992_2.png) [@w.k](https://community.dreamfactory.com/u/w.k)\
**Post date:** [April 7, 2017, 7:08pm UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767/1 "2017-04-07T19:08:24Z")

</div>

Hi!

Making first steps with Dreamfactory and followed the tutorial I am not finding, how could I apply role to the user, when I want user to access some service (and not app).

Here  
[https://wiki.dreamfactory.com/DreamFactory/Tutorials/Accessing\_SQL\_tables](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Accessing_SQL_tables)  
is described, how to create such role, but on User-tab there is no place to apply roles for services, there is only list of apps.

How could I achieve it?

TIA,

Gunnar

---

<div class="post-metadata">

**Author:** ![w.k](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/w.k/32/992_2.png) [@w.k](https://community.dreamfactory.com/u/w.k)\
**Post date:** [April 11, 2017, 12:41am UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767/2 "2017-04-11T00:41:16Z")

</div>

Hi again!

While waiting my message to appear here I had time to experiment. Now I can propose solution too: you can make a role with just those permissions you need to apply for certain service and then let the user has this role for `api_docs` app. It worked like that, but was not intuitive to set up that way.

If that is somewhere in docs, i misread it. If it is not, then it would be good to have it, don’t you think?

And, like in the other topic: it would be great to adjust automatically the documentation of the API to the same level with permissions.

Wbr,

Gunnar

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [May 3, 2017, 12:58pm UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767/3 "2017-05-03T12:58:57Z")

</div>

You can also create a new app that is just a logical app (i.e. not connected to any specific code hosted on the system) and use that key to associate your users and roles.

---

<div class="post-metadata">

**Author:** ![w.k](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/w.k/32/992_2.png) [@w.k](https://community.dreamfactory.com/u/w.k)\
**Post date:** [May 3, 2017, 1:22pm UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767/4 "2017-05-03T13:22:00Z")

</div>

> [@formerstaff](#):
>
> You can also create a new app that is just a logical app (i.e. not connected to any specific code hosted on the system) and use that key to associate your users and roles.

Could you provide some example, please? For example, what I asked here:

> **[Database Table Endpoint Obfuscation Through Custom Scripting - DreamFactory...](https://blog.dreamfactory.com/database-table-endpoint-obfuscation-through-custom-scripting/)**
>
> DreamFactory’s power lies in the automatic generation of API endpoints and its standardization. There are times however, where you need something a little more custom, and that’s why we have scripting engines included. Let’s look at a specific use...

How to create logical app for that script? So I could use this app to bind roles to user and use API key for this endpoint.

TIA,  
Gunnar

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [May 3, 2017, 1:46pm UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767/5 "2017-05-03T13:46:00Z")

</div>

Just go to Apps. Create a new app. Give it a name. Set it to active and select “No storage required.”

---

<div class="post-metadata">

**Author:** ![w.k](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/w.k/32/992_2.png) [@w.k](https://community.dreamfactory.com/u/w.k)\
**Post date:** [May 3, 2017, 1:56pm UTC](https://community.dreamfactory.com/t/how-to-apply-role-to-user/3767/6 "2017-05-03T13:56:56Z")

</div>

Thank you for holding hand 😉

It was hard, but seems to work now. Getting now

```
This instance cannot run server-side javascript scripts. The 'v8js' is not available.

```

But this is another topic and big leap forward for me. Thank you!
