Jelajahi Sumber

fix: add comment about rbacwithadmin being rather powerful (#936)

* fix: add comment about rbacwithadmin being rather powerful
* fix: move RBACWithAdmin to examples
Matt Condon 7 tahun lalu
induk
melakukan
2637bd89be
2 mengubah file dengan 9 tambahan dan 2 penghapusan
  1. 8 1
      contracts/examples/RBACWithAdmin.sol
  2. 1 1
      contracts/mocks/RBACMock.sol

+ 8 - 1
contracts/ownership/rbac/RBACWithAdmin.sol → contracts/examples/RBACWithAdmin.sol

@@ -1,6 +1,6 @@
 pragma solidity ^0.4.23;
 
-import "./RBAC.sol";
+import "../ownership/rbac/RBAC.sol";
 
 
 /**
@@ -8,6 +8,13 @@ import "./RBAC.sol";
  * @author Matt Condon (@Shrugs)
  * @dev It's recommended that you define constants in the contract,
  * @dev like ROLE_ADMIN below, to avoid typos.
+ * @dev
+ * @dev NOTE: RBACWithAdmin is probably too expansive and powerful for your
+ * @dev  application; an admin is actually able to change any address to any role
+ * @dev  which is a very large API surface. It's recommended that you follow a strategy
+ * @dev  of strictly defining the abilities of your roles
+ * @dev  and the API-surface of your contract.
+ * @dev  This is just an example for example's sake.
  */
 contract RBACWithAdmin is RBAC {
   /**

+ 1 - 1
contracts/mocks/RBACMock.sol

@@ -1,6 +1,6 @@
 pragma solidity ^0.4.23;
 
-import "../ownership/rbac/RBACWithAdmin.sol";
+import "../examples/RBACWithAdmin.sol";
 
 
 contract RBACMock is RBACWithAdmin {