25 lines
456 B
Go
25 lines
456 B
Go
package database
|
|
|
|
type GroupPermission struct {
|
|
GroupID int32 `bun:",notnull" json:"-"`
|
|
Value int8 `bun:",notnull" json:"value"`
|
|
}
|
|
|
|
func InsertGroupPermissions(gp []*GroupPermission) error {
|
|
_, err := PG.NewInsert().
|
|
Model(&gp).
|
|
Returning("NULL").
|
|
Exec(ctx)
|
|
|
|
return err
|
|
}
|
|
|
|
func DeleteGroupPermissions(groupid int32) error {
|
|
_, err := PG.NewDelete().
|
|
Model(new(GroupPermission)).
|
|
Where("group_id = ?", groupid).
|
|
Exec(ctx)
|
|
|
|
return err
|
|
}
|