Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Authorize other accountsForum ↗

Authorize other accounts

App Development2 posts150 viewsLast activity Feb 2023
TI
Tinglei_ZhangOP
Feb 2023

How can I authorize another user to operate my contract?

WA
WallaceKelly
Feb 2023

This example adapted from here uses the theme of an address book.

template Contact
  with
    myself : Party
    myFriend : Party
    address : Text
    telephone : Text
  where
    signatory myself
    observer myFriend

    choice UpdateAddress
      : ContractId Contact
      with
        newAddress : Text
      controller myFriend
      do
        create this with
          address = newAddress

Notice that myself creates the contract, as the signatory. Also notice that myFriend can exercise a choice on the contract, as the controller on the UpdateAddress choice.

Does that answer your question? Or maybe there is something on this page that leads to more questions?

← Back to Discussions