Skip to content

Commit

Permalink
feat: move roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahanmmi committed Jul 24, 2024
1 parent 4bcbd19 commit 7606324
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pkg/api/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import "strings"
type Role string

const (
GodUserID = "god-kaytu-user"
)

const (
InternalRole Role = "internal"
KaytuAdminRole Role = "kaytu-admin"
AdminRole Role = "admin"
EditorRole Role = "editor"
Expand All @@ -13,6 +18,8 @@ const (

func GetRole(s string) Role {
switch strings.TrimSpace(strings.ToLower(s)) {
case string(InternalRole):
return InternalRole
case string(KaytuAdminRole):
return KaytuAdminRole
case string(AdminRole):
Expand Down
4 changes: 2 additions & 2 deletions pkg/httpclient/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/kaytu-io/kaytu-engine/pkg/httpserver"
"io"
"mime/multipart"
"net/http"
url2 "net/url"
"time"

"github.com/kaytu-io/kaytu-engine/pkg/auth/api"
"github.com/kaytu-io/kaytu-util/pkg/api"
"github.com/kaytu-io/kaytu-util/pkg/httpserver"
"github.com/labstack/echo/v4"
)

Expand Down

0 comments on commit 7606324

Please sign in to comment.