Add role management

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-11-07 09:20:38 +01:00
parent 696adb7d79
commit 21c4b7cd9d
143 changed files with 5976 additions and 2094 deletions

View File

@@ -77,9 +77,9 @@ func ExtractEmailDomain(email string) (string, error) {
return domain, nil
}
func MapSAMLRoleToSystemRole(samlRole string) *coredata.Role {
func MapSAMLRoleToSystemRole(samlRole string) *coredata.MembershipRole {
if samlRole != "" && isValidRole(samlRole) {
role := coredata.Role(samlRole)
role := coredata.MembershipRole(samlRole)
return &role
}
@@ -88,7 +88,7 @@ func MapSAMLRoleToSystemRole(samlRole string) *coredata.Role {
func isValidRole(role string) bool {
switch role {
case "OWNER", "ADMIN", "MEMBER", "VIEWER":
case "OWNER", "ADMIN", "VIEWER":
return true
default:
return false