diff --git a/README.md b/README.md index 957eeb92a34bb1af0f07fbf6e633705a7e4c045d..69573920f0ca6230e49a0213043fa2677ff6093f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ | Master | [](https://circleci.com/gh/monax/burrow/tree/master) | | Develop | [](https://circleci.com/gh/monax/burrow/tree/develop) | -burrow is Monax' permissioned blockchain client. It executes Ethereum smart contracts on a permissioned virtual machine. burrow provides transaction finality and high transaction throughput on proof-of-stake Tendermint consensus engine. For smart contract development most functionality is provided by `monax chains`, exposed through [monax](https://monax.io/docs), the entry point for the Monax Platform. +Burrow is Monax' permissioned blockchain client. It executes Ethereum smart contracts on a permissioned virtual machine. Burrow provides transaction finality and high transaction throughput on proof-of-stake Tendermint consensus engine. For smart contract development most functionality is provided by `monax chains`, exposed through [monax](https://monax.io/docs), the entry point for the Monax Platform. ## Table of Contents diff --git a/permission/types/util.go b/permission/types/util.go index fddf0b9eb2b161b1f4df36733afcba29c429ae75..c7ceae90bd1f97e30793551cb04f73104df629eb 100644 --- a/permission/types/util.go +++ b/permission/types/util.go @@ -14,12 +14,12 @@ package types -// ConvertMapStringIntToPermissions converts a map of string-integer pairs and a slice of -// strings for the roles to an AccountPermissions type. The integer needs to be greater -// than zero to set the permission. For all unmentioned permissions the ZeroBasePermissions -// is defaulted to. -// TODO: [ben] re-evaluate the use of int for setting the permission. -func ConvertPermissionsMapAndRolesToAccountPermissions(permissions map[string]int, roles []string) (*AccountPermissions, error) { +// ConvertMapStringIntToPermissions converts a map of string-bool pairs and a slice of +// strings for the roles to an AccountPermissions type. If the value in the +// permissions map is true for a particular permission string then the permission +// will be set in the AccountsPermissions. For all unmentioned permissions the +// ZeroBasePermissions is defaulted to. +func ConvertPermissionsMapAndRolesToAccountPermissions(permissions map[string]bool, roles []string) (*AccountPermissions, error) { var err error accountPermissions := &AccountPermissions{} accountPermissions.Base, err = convertPermissionsMapStringIntToBasePermissions(permissions) @@ -30,9 +30,9 @@ func ConvertPermissionsMapAndRolesToAccountPermissions(permissions map[string]in return accountPermissions, nil } -// convertPermissionsMapStringIntToBasePermissions converts a map of string-integer pairs to -// BasePermissions. -func convertPermissionsMapStringIntToBasePermissions(permissions map[string]int) (BasePermissions, error) { +// convertPermissionsMapStringIntToBasePermissions converts a map of string-bool +// pairs to BasePermissions. +func convertPermissionsMapStringIntToBasePermissions(permissions map[string]bool) (BasePermissions, error) { // initialise basePermissions as ZeroBasePermissions basePermissions := ZeroBasePermissions @@ -42,7 +42,7 @@ func convertPermissionsMapStringIntToBasePermissions(permissions map[string]int) return basePermissions, err } // sets the permissions bitflag and the setbit flag for the permission. - basePermissions.Set(permissionsFlag, value > 0) + basePermissions.Set(permissionsFlag, value) } return basePermissions, nil