# Get user role from api?

**URL:** <https://community.dreamfactory.com/t/get-user-role-from-api/1240>\
**Category:** Authentication & Security\
**Created:** [July 1, 2015, 6:44pm UTC](https://community.dreamfactory.com/t/get-user-role-from-api/1240 "2015-07-01T18:44:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manol](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@manol](https://community.dreamfactory.com/u/manol)\
**Post date:** [July 1, 2015, 6:44pm UTC](https://community.dreamfactory.com/t/get-user-role-from-api/1240/1 "2015-07-01T18:44:44Z")

</div>

Is it a way to get the role description of the logged user?

I’m using angular, but any js code would be fine.

Thank you.

---

<div class="post-metadata">

**Author:** ![manol](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@manol](https://community.dreamfactory.com/u/manol)\
**Post date:** [July 2, 2015, 4:19pm UTC](https://community.dreamfactory.com/t/get-user-role-from-api/1240/2 "2015-07-02T16:19:31Z")

</div>

I just solve that by creating a custom script and calling it form my angular app, but now arise a new problem, if I’m logged as an administrator I get results back otherwise I get POST [http://dreamfactory.jr](http://dreamfactory.jr)…pp.com/rest/system/script/add/ 403 (Forbidden)

**My question:** Is there a way to access to custom scripts being a registered user instead of an administrator?

**Server side (custom script)**

```
    var path = "system/role/" + event.id;
var role = platform.api.get(path);
    return role; 

```

**Browser side (angular)**

```
var getRole = function (roleID) {
$http({
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  url: 'http://dreamfactory.jr...pp.com/rest/system/script/userrole/',
  data: $.param({ is_user_script:true, id:roleID }), 
})
.success(function(response) { console.debug("role data",response); });

```

}

---

<div class="post-metadata">

**Author:** ![manol](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@manol](https://community.dreamfactory.com/u/manol)\
**Post date:** [July 2, 2015, 4:43pm UTC](https://community.dreamfactory.com/t/get-user-role-from-api/1240/3 "2015-07-02T16:43:29Z")

</div>

**SOLVED:**

I had to go to the specific role, choose access tab \> System Access, then:

 ![](https://canada1.discourse-cdn.com/flex035/uploads/dreamfactory/original/1X/4f19ec8eab1785ddaf84f35be5d7b8dc5ed6d0ff.png)
