# User Role on Sequence creation

**URL:** https://discuss.tryton.org/t/user-role-on-sequence-creation/3178
**Category:** Developer
**Tags:** res
**Created:** [September 2, 2020, 6:23pm UTC](https://discuss.tryton.org/t/user-role-on-sequence-creation/3178 "2020-09-02T18:23:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![formateli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/formateli/32/579_2.png) [@formateli](https://discuss.tryton.org/u/formateli)
#### Post date: [September 2, 2020, 6:23pm UTC](https://discuss.tryton.org/t/user-role-on-sequence-creation/3178/1 "2020-09-02T18:23:48Z")

</div>

Hi all,

Accorging to [User Role](https://docs.tryton.org/projects/modules-user-role/en/latest/) documentation, when a role is added to a user, it overrides the existing groups

I created a user and a user role, added all groups to the user role (res.role-res.group) and add the role to user (res.user.role), all in same transaction. If I create a sequence with this user I get:

```
You are not allowed to write to records "XX" of "Sequence" because of 
at least one of these rules:
User in groups

```

If I add all groups to the user this not happens

Any idea?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [September 2, 2020, 9:07pm UTC](https://discuss.tryton.org/t/user-role-on-sequence-creation/3178/2 "2020-09-02T21:07:46Z")

</div>

As you do that in a single transaction, I guess it depends on how things are done.  
For example, synchronization of roles are only done when User is written (not if the relation is created).

---

<div class="post-metadata">

### Author: ![formateli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/formateli/32/579_2.png) [@formateli](https://discuss.tryton.org/u/formateli)
#### Post date: [September 2, 2020, 11:28pm UTC](https://discuss.tryton.org/t/user-role-on-sequence-creation/3178/3 "2020-09-02T23:28:25Z")

</div>

I added the res.user.role relation to user, saved and done. Thank you.

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [October 2, 2020, 11:28pm UTC](https://discuss.tryton.org/t/user-role-on-sequence-creation/3178/4 "2020-10-02T23:28:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
