Updated permissions documentation to remove inactive status for accounts. Modified contract to fix issue with suborg id when node is added to sub orgs (#950)

This commit is contained in:
Sai V 2020-03-10 23:08:14 +08:00 committed by GitHub
parent 1275599573
commit 0c7cd71122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,7 @@ The permissions smart contract design follows the Proxy-Implementation-Storage p
* `PermissionsInterface.sol`: This is the interface contract and holds the interfaces for permissions related actions. It has no business logic and forwards requests to the current implementation contract
* `PermissionsImplementation.sol`: This contract has the business logic for the permissions actions. It can receive requests only from a valid interface as defined in `PermissionsUpgradable.sol` and interacts with all the storage contracts for respective actions.
* `OrgManager.sol`: This contract stores data for organizations and sub organizations. It can receive requests from a valid implementation contract as defined in `PermissionsUpgrdable.sol`
* `AccountManager.sol`: This contract receives requests from a valid implementation contract as defined in `PermissionsUpgrdable.sol`. It stores the data of all accounts, their linkage to organization and various roles. The contract also stores the status of an account. The account can be in any of the following status - `PendingApproval`, `Active`, `Inactive`, `Suspended`, `Blacklisted` or `Revoked`
* `AccountManager.sol`: This contract receives requests from a valid implementation contract as defined in `PermissionsUpgrdable.sol`. It stores the data of all accounts, their linkage to organization and various roles. The contract also stores the status of an account. The account can be in any of the following status - `PendingApproval`, `Active`, `Suspended`, `Blacklisted` or `Revoked`
* `NodeManager.sol`: This contract receives requests from a valid implementation contract as defined in `PermissionsUpgrdable.sol`. It stores the data of a node, its linkage to an organization or sub organization, and status of the node. The node can be in any one of the following status - `PendingApproval`, `Approved`, `Deactivated` or `Blacklisted`
* `RoleManager.sol`: This contract receives requests from a valid implementation contract as defined in `PermissionsUpgrdable.sol`. It stores data for various roles and the organization to which it is linked. The access at role level can be any one of the following:
- `Readonly` which allows only read operations

View File

@ -849,7 +849,6 @@ The table below indicates the numeric value for various account status.
| Not In List | 0 |
| Pending Approval | 1 |
| Active | 2 |
| Inactive | 3 |
| Suspended | 4 |
| Blacklisted | 5 |
| Revoked | 6 |

View File

@ -257,7 +257,7 @@ contract PermissionsImplementation {
string calldata _enodeId, address _caller) external onlyInterface
orgExists(_pOrgId) orgAdmin(_caller, _pOrgId) {
orgManager.addSubOrg(_pOrgId, _orgId);
string memory pOrgId = string(abi.encode(_pOrgId, ".", _orgId));
string memory pOrgId = string(abi.encodePacked(_pOrgId, ".", _orgId));
if (bytes(_enodeId).length > 0) {
nodeManager.addOrgNode(_enodeId, pOrgId);
}