Skip to content
Snippets Groups Projects
Unverified Commit 07dff7f5 authored by Silas Davis's avatar Silas Davis
Browse files

Fix comments in permissions util

parent 73a741d1
No related branches found
No related tags found
No related merge requests found
......@@ -14,11 +14,11 @@
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.
// 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{}
......@@ -30,8 +30,8 @@ func ConvertPermissionsMapAndRolesToAccountPermissions(permissions map[string]bo
return accountPermissions, nil
}
// convertPermissionsMapStringIntToBasePermissions converts a map of string-integer pairs to
// BasePermissions.
// convertPermissionsMapStringIntToBasePermissions converts a map of string-bool
// pairs to BasePermissions.
func convertPermissionsMapStringIntToBasePermissions(permissions map[string]bool) (BasePermissions, error) {
// initialise basePermissions as ZeroBasePermissions
basePermissions := ZeroBasePermissions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment