# Granting permissions like createdb between roles isn't working

**URL:** <https://forum.yugabyte.com/t/granting-permissions-like-createdb-between-roles-isnt-working/839>\
**Category:** General\
**Created:** [October 14, 2020, 3:42pm UTC](https://forum.yugabyte.com/t/granting-permissions-like-createdb-between-roles-isnt-working/839 "2020-10-14T15:42:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [October 14, 2020, 3:42pm UTC](https://forum.yugabyte.com/t/granting-permissions-like-createdb-between-roles-isnt-working/839/1 "2020-10-14T15:42:02Z")

</div>

[Question posted by a user on [YugabyteDB Community Slack](https://www.yugabyte.com/slack) ]

I’m creating a new role that can CREATEDB which can be inherited by other roles/users:

```auto
CREATE ROLE new_role NOSUPERUSER INHERIT CREATEDB NOCREATEROLE;
CREATE ROLE new_user LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
GRANT new_role TO new_user;

```

Now after I connect as `new_user`, I can’t create a database:

```auto
yugabyte=> CREATE DATABASE foobar;
ERROR: permission denied to create database

```

---

<div class="post-metadata">

**Author:** ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)\
**Post date:** [October 24, 2020, 11:45am UTC](https://forum.yugabyte.com/t/granting-permissions-like-createdb-between-roles-isnt-working/839/2 "2020-10-24T11:45:34Z")

</div>

Not all attributes (including CREATEDB) are inherited in PostgreSQL. You must manually assign them.

From PostgreSQL docs: [PostgreSQL: Documentation: 16: 22.3.&nbsp;Role Membership](https://www.postgresql.org/docs/current/role-membership.html)

> The role attributes **LOGIN** , **SUPERUSER** , **CREATEDB** , and **CREATEROLE** can be thought of as special privileges, but they are never inherited as ordinary privileges on database objects are.  
> You must actually `SET ROLE` to a specific role having one of these attributes in order to make use of the attribute.
