Add initial implementation of grants
This commit is contained in:
parent
b8f1281f78
commit
69b6579de7
15 changed files with 308 additions and 73 deletions
27
internal/dis/component/auth/policy/policy.go
Normal file
27
internal/dis/component/auth/policy/policy.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package policy
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/sql"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/models"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Policy struct {
|
||||
component.Base
|
||||
|
||||
Dependencies struct {
|
||||
SQL *sql.SQL
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
_ component.Provisionable = (*Policy)(nil)
|
||||
_ component.UserDeleteHook = (*Policy)(nil)
|
||||
)
|
||||
|
||||
func (pol *Policy) table(ctx context.Context) (*gorm.DB, error) {
|
||||
return pol.Dependencies.SQL.QueryTable(ctx, true, models.GrantTable)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue