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 (
|
||||
"fmt"
|
||||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -50,12 +51,7 @@ type User struct {
|
||||
}
|
||||
|
||||
func (u *User) HasProject(project string) bool {
|
||||
for _, p := range u.Projects {
|
||||
if p == project {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(u.Projects, project)
|
||||
}
|
||||
|
||||
func GetRoleString(roleInt Role) string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user