Smart Raise

Smart Raise

  • Docs
  • API
  • User Guide (de)

›RBAC

DISCOVERY

  • Discovery

PAYOUT

  • PayoutApproval
  • Refundable

PROJECT

  • Content
  • PhaseSaver
  • Phases
  • ProjectInfo
  • ProjectStatus
  • StateMachine

RBAC

  • Auditor
  • RBAC
  • RbacSmartRaise
  • Roles

SUPPORTERS

  • FundingStatus
  • Payinable
  • Supportable
  • SupportableStatistics

UNCATEGORIZED

  • Smartraise

RBAC

contract RBAC

Stores and provides setters and getters for roles and addresses. Supports unlimited numbers of roles and addresses. See //contracts/mocks/RBACMock.sol for an example of usage. This RBAC method uses strings to key roles. It may be beneficial for you to write your own implementation of this interface using Enums or similar.

Source: rbac/RBAC.sol
Author: Matt Condon (@Shrugs)

Index

  • RoleAdded
  • RoleRemoved
  • addRole
  • checkRole
  • hasRole
  • onlyRole
  • removeRole

Reference

Events

  • RoleAdded

    event RoleAdded(address operator, string role)
    Parameters:
    operator - address
    role - string
  • RoleRemoved

    event RoleRemoved(address operator, string role)
    Parameters:
    operator - address
    role - string

Modifiers

  • onlyRole

    modifier onlyRole(string _role)

    Modifier to scope access to a single role (uses msg.sender as addr).

    Parameters:
    _role - the name of the role // reverts

Functions

  • addRole

    function addRole(address _operator, string _role) internal

    Add a role to an address.

    Parameters:
    _operator - address
    _role - the name of the role
  • checkRole

    function checkRole(address _operator, string _role) public view

    Reverts if addr does not have role.

    Parameters:
    _operator - address
    _role - the name of the role // reverts
  • hasRole

    function hasRole(address _operator, string _role) public view returns (bool)

    Determine if addr has role.

    Parameters:
    _operator - address
    _role - the name of the role
    Returns:
    bool
  • removeRole

    function removeRole(address _operator, string _role) internal

    Remove a role from an address.

    Parameters:
    _operator - address
    _role - the name of the role
← AuditorRbacSmartRaise →
Copyright © 2019 Zoltan Vandor