# Button access for specific user dynamically

**URL:** https://discuss.tryton.org/t/button-access-for-specific-user-dynamically/4007
**Category:** Developer
**Created:** [April 5, 2021, 3:07am UTC](https://discuss.tryton.org/t/button-access-for-specific-user-dynamically/4007 "2021-04-05T03:07:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![enixzyrex](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@enixzyrex](https://discuss.tryton.org/u/enixzyrex)
#### Post date: [April 5, 2021, 3:07am UTC](https://discuss.tryton.org/t/button-access-for-specific-user-dynamically/4007/1 "2021-04-05T03:07:08Z")

</div>

Hi, may I know how can I allow button access for only 1 specific user that is chosen by another user?

For example, user A selects user B in `Witness` field, then only user B would be able to access the button. (Button depending on `Witness` field)

It seems like buttons doesn’t have button access nor domains to control them dynamically. I also tried `ir.model.button.rule` but I think I’ve gotten the `Condition` wrong (I tried using it like domain)

---

<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: [April 5, 2021, 7:01am UTC](https://discuss.tryton.org/t/button-access-for-specific-user-dynamically/4007/2 "2021-04-05T07:01:11Z")

</div>

The button rules are just to count the number of user having clicked on the button per record.  
There is no standard way to do what you want (personally I do not think it is a good idea because you are blocking the workflow to a unique user) so you will have to implement it completely yourself.

---

<div class="post-metadata">

### Author: ![enixzyrex](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@enixzyrex](https://discuss.tryton.org/u/enixzyrex)
#### Post date: [April 6, 2021, 1:13am UTC](https://discuss.tryton.org/t/button-access-for-specific-user-dynamically/4007/3 "2021-04-06T01:13:10Z")

</div>

> [@ced](#):
>
> The button rules are just to count the number of user having clicked on the button per record.

Ohh… did not know about this.

Okay thanks. I’ll try to find other approaches to the requirement then.

---

<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: [May 6, 2021, 1:13am UTC](https://discuss.tryton.org/t/button-access-for-specific-user-dynamically/4007/4 "2021-05-06T01:13:12Z")

</div>

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