From 0ee7387f7eed753c7891a8170423328eea26c965 Mon Sep 17 00:00:00 2001 From: Brett Wright Date: Mon, 2 Nov 2020 08:59:39 +0100 Subject: [PATCH] Added limited Guest access for groups and users --- client/project_members.go | 4 ++++ provider/resource_project_member_group.go | 4 ++-- provider/resource_project_member_user.go | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/project_members.go b/client/project_members.go index d14b603..dee93a0 100644 --- a/client/project_members.go +++ b/client/project_members.go @@ -46,6 +46,8 @@ func RoleTypeNumber(role int) (x string) { x = "guest" case 4: x = "master" + case 5: + x = "limitedguest" } return x } @@ -60,6 +62,8 @@ func RoleType(role string) (x int) { x = 3 case "master": x = 4 + case "limitedguest": + x = 5 } return x } diff --git a/provider/resource_project_member_group.go b/provider/resource_project_member_group.go index d928c3b..6596d03 100644 --- a/provider/resource_project_member_group.go +++ b/provider/resource_project_member_group.go @@ -31,8 +31,8 @@ func resourceMembersGroup() *schema.Resource { Required: true, ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { v := val.(string) - if v != "projectadmin" && v != "developer" && v != "guest" && v != "master" { - errs = append(errs, fmt.Errorf("%q must be either projectadmin, developer, guest or master, got: %s", key, v)) + if v != "projectadmin" && v != "developer" && v != "guest" && v != "master" && v != "limitedguest" { + errs = append(errs, fmt.Errorf("%q must be either projectadmin, developer, guest, limitedguest or master, got: %s", key, v)) } return }, diff --git a/provider/resource_project_member_user.go b/provider/resource_project_member_user.go index bbbf05b..56a5aab 100644 --- a/provider/resource_project_member_user.go +++ b/provider/resource_project_member_user.go @@ -31,8 +31,8 @@ func resourceMembersUser() *schema.Resource { Required: true, ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { v := val.(string) - if v != "projectadmin" && v != "developer" && v != "guest" && v != "master" { - errs = append(errs, fmt.Errorf("%q must be either projectadmin, developer, guest or master, got: %s", key, v)) + if v != "projectadmin" && v != "developer" && v != "guest" && v != "master" && v != "limitedguest" { + errs = append(errs, fmt.Errorf("%q must be either projectadmin, developer, guest, limitedguest or master, got: %s", key, v)) } return },