# Party visibility and Contract owner change on "to-do list" example

**URL:** <https://forum.canton.network/t/party-visibility-and-contract-owner-change-on-to-do-list-example/4805>\
**Category:** App Development\
**Created:** [June 29, 2022, 11:30am UTC](https://forum.canton.network/t/party-visibility-and-contract-owner-change-on-to-do-list-example/4805 "2022-06-29T11:30:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakub](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jakub](https://forum.canton.network/u/jakub)\
**Post date:** [June 29, 2022, 11:30am UTC](https://forum.canton.network/t/party-visibility-and-contract-owner-change-on-to-do-list-example/4805/1 "2022-06-29T11:30:30Z")

</div>

Hello!

I’m trying to make a “to-do list” app in DAML, and I have two main problems.  
First:  
Assumptions:

- Users have 3 roles (admin, support or user)
- Only admin can create new users
- Admin and support can change other user’s role (e.g. support can change user role from “user” to “support”)
- If possible: Support is able to see all Users, but User cannot see other User

What I have:  
If admin create an user, and this user is not visible to anyone except admin

user template:

```haskell
template UserModel
    with
        masterAdmin: Party
        username: Party
        role: Role
        supporters: [Party]
    where
        signatory masterAdmin
        observer login, supporters

```

What I want:  
Support should be able to change role of every created user. Is delegation pattern only way to do it? Now I have empty Party list on every user, and if I want Support to change user role:

1. Admin add support to supporter list
2. Support have what he have to
3. Admin remove support from supporters list

Second problem:  
Is very similar to first. I have a “task” template:

```haskell
template Task 
    with
        name: Text
        issuer: Party
        possibleExecutors: [Party]
    where
        signatory issuer
        observer possibleExecutors

```

What I want:

- My issuer should be able to add every user to “possibleExecutors”. (so we go back to first problem)
- Admin should have the same possibilities as Issuer (e.g. my issuer is not available and I as admin want to exercise every choice, e.g. mark task as done).

What I can achieve that? Is there any way to archive and recreate contract with other issuer?

At the end, I want to do these things on front-end side or API calls (but I don’t think that this make any differcence)  
I’m sorry, if anything is not clear here

---

<div class="post-metadata">

**Author:** ![jakub](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jakub](https://forum.canton.network/u/jakub)\
**Post date:** [July 6, 2022, 2:32pm UTC](https://forum.canton.network/t/party-visibility-and-contract-owner-change-on-to-do-list-example/4805/2 "2022-07-06T14:32:16Z")

</div>

I figured out a solution.

First problem: stays uchanged. I think that a list, where I can add observer is the best solution for me so far.

Second problem (I wanted that admin could do anything): I used a dynamic signatory trick and this works just fine.  
It’s Bernhard post in this topic:

> [@How can I implement the case that the contract requires dynamic numbers of signatories?](https://discuss.daml.com/t/how-can-i-implement-the-case-that-the-contract-requires-dynamic-numbers-of-signatories/1636):
>
> Here’s my code and I don’t kown how to continue. template ContractWithMultiSignatories with signatories: [Party] where signatory signatories template ContracProposal with contract: ContractWithMultiSignatories submitter: Party signed: [Party] where signatory submitter observer contract.signatories controller contract.signatories can Accept : ContractId ContractWithMultiSignatories do assertMsg "Somebody hasn't signed" (contract.si…

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [July 6, 2022, 4:45pm UTC](https://forum.canton.network/t/party-visibility-and-contract-owner-change-on-to-do-list-example/4805/3 "2022-07-06T16:45:48Z")

</div>

Really awesome to hear you figure it out 👏 (and were able to find a helpful post on the forum 🙂)
