LCOV - code coverage report
Current view: top level - irohad/model/commands - create_role.hpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 1 1 100.0 %
Date: 2019-03-07 14:46:43 Functions: 6 7 85.7 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Soramitsu Co., Ltd. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0
       4             :  */
       5             : #ifndef IROHA_CREATE_ROLE_HPP
       6             : #define IROHA_CREATE_ROLE_HPP
       7             : 
       8             : #include <set>
       9             : #include <string>
      10             : #include "model/command.hpp"
      11             : 
      12             : namespace iroha {
      13             :   namespace model {
      14             : 
      15             :     /**
      16             :      * Create new role in the system
      17             :      */
      18             :     struct CreateRole : public Command {
      19             :       /**
      20             :        * Role to insert to the system
      21             :        */
      22             :       std::string role_name;
      23             : 
      24             :       /**
      25             :        * Role permissions
      26             :        */
      27             :       std::set<std::string> permissions;
      28             : 
      29             :       bool operator==(const Command &command) const override;
      30             : 
      31             :       CreateRole() {}
      32             :       /**
      33             :        * @param role_name_ - name of the role in the system
      34             :        * @param perms - set of permissions for the role
      35             :        */
      36             :       CreateRole(const std::string &role_name_,
      37             :                  const std::set<std::string> &perms)
      38          92 :           : role_name(role_name_), permissions(perms) {}
      39             :     };
      40             :   }  // namespace model
      41             : }  // namespace iroha
      42             : #endif  // IROHA_CREATE_ROLE_HPP

Generated by: LCOV version 1.13