Secure the networkBug Bounty!November 2018

AuthorityClient

The AuthorityClient is a standard interface for interactions with functions and events described in Authority.sol.

In the current implementation of the Colony Network, some events on-chain are not mediated by reputation scores as described in the whitepaper. Rather, certain actions within a colony that would ordinarily require some minimum reputation are assigned an 'authority' of Colony Owner and Colony Admin. This includes colony-wide actions such as minting new colony tokens as well as the creation and finalization of tasks.

The roles of OWNER and ADMIN are able to call certain specific functions on the Colony Network, which are not permitted by addresses without an authorityRole defined.

Role: OWNERRole: ADMIN
setTokenX
mintTokensX
addGlobalSkill (Meta Colony only)X
addDomainXX
moveFundsBetweenPotsXX
startNextRewardPayoutXX
createTaskXX
cancelTaskXX
setAdminXX
removeAdminX

Note: these authority roles are distinct from the 'roles' assigned in a task (manager, worker, and evaluator). See the task lifecycle for a summary of task roles.

Callers

All callers return promises which resolve to an object containing the given return values. For a reference please check here.

getUserRole.call({ user })

Get the given user's role.

Arguments

ArgumentTypeDescription
userAddressThe user in question.

Returns

A promise which resolves to an object containing the following properties:

Return valueTypeDescription
roleAuthority RoleThat user's authority role ( OWNER or ADMIN ).

hasUserRole.call({ user, role })

For the given user's address and role, return true if the user has that role.

Arguments

ArgumentTypeDescription
userAddressThe user in question
roleAuthority RoleThe role to be checked ( OWNER or ADMIN ).

Returns

A promise which resolves to an object containing the following properties:

Return valueTypeDescription
hasRolebooleanWhether or not the user has the role provided.

Senders

All senders return an instance of a ContractResponse. Every send() method takes an options object as the second argument. For a reference please check here.

setUserRole.send({ user, role, enabled }, options)

Enable or disable a particular role for a user's address (default behaviour: enable the role).

Arguments

ArgumentTypeDescription
userAddressThe user address to be granted (or stripped of) authority.
roleAuthority RoleThe authority role ( OWNER or ADMIN ).
enabledbooleanWhether or not that role has been enabled.

Returns

An instance of a ContractResponse