mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-06-08 00:23:48 +02:00
Refactor
This commit is contained in:
parent
7db83d216e
commit
3b5d3d671e
@ -6,6 +6,7 @@ package schema
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,12 +51,7 @@ type User struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) HasProject(project string) bool {
|
func (u *User) HasProject(project string) bool {
|
||||||
for _, p := range u.Projects {
|
return slices.Contains(u.Projects, project)
|
||||||
if p == project {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRoleString(roleInt Role) string {
|
func GetRoleString(roleInt Role) string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user