roles
This commit is contained in:
parent
8c8cbfd7dd
commit
41d48bf60a
28 changed files with 434 additions and 7 deletions
29
types/fixtures/category.go
Normal file
29
types/fixtures/category.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package fixtures
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"git.sapphic.engineer/roleypoly/v4/types"
|
||||
)
|
||||
|
||||
var (
|
||||
CategoryMulti = types.Category{
|
||||
ID: "multi",
|
||||
Name: "Roles",
|
||||
Type: types.CategoryMultiple,
|
||||
Roles: []string{RoleWithDarkColor.ID, RoleWithLightColor.ID, RoleWithoutColor.ID},
|
||||
}
|
||||
|
||||
CategorySingle = types.Category{
|
||||
ID: "single",
|
||||
Name: "Roles",
|
||||
Type: types.CategorySingle,
|
||||
Roles: []string{RoleWithDarkColor.ID, RoleWithLightColor.ID, RoleWithoutColor.ID},
|
||||
}
|
||||
)
|
||||
|
||||
func Category(base types.Category) *types.Category {
|
||||
base.ID = fmt.Sprintf("%s-%d", base.ID, rand.Uint32())
|
||||
return &base
|
||||
}
|
32
types/fixtures/role.go
Normal file
32
types/fixtures/role.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package fixtures
|
||||
|
||||
import "git.sapphic.engineer/roleypoly/v4/types"
|
||||
|
||||
var (
|
||||
RoleWithDarkColor = types.Role{
|
||||
ID: "dark-color",
|
||||
Name: "role with dark color",
|
||||
Color: 0xa20000,
|
||||
Permissions: 0,
|
||||
Position: 10,
|
||||
}
|
||||
RoleWithLightColor = types.Role{
|
||||
ID: "light-color",
|
||||
Name: "role with light color",
|
||||
Color: 0xffaa88,
|
||||
Permissions: 0,
|
||||
Position: 10,
|
||||
}
|
||||
RoleWithoutColor = types.Role{
|
||||
ID: "without-color",
|
||||
Name: "role",
|
||||
Color: 0x000000,
|
||||
Permissions: 0,
|
||||
Position: 11,
|
||||
}
|
||||
//TODO: role with admin (bad)
|
||||
//TODO: role with manage roles (bad)
|
||||
//TODO: role above roleypoly (bad)
|
||||
//TODO: role with managed (bad)
|
||||
//TODO: role that is roleypoly (hi)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue