- moved Access type from system to internal/rules, - moved Resource from system to internal/rules, - update imports for new type locations, - add scope list container to inject permissions, - update permissions API call to return default perms, - update codegen for generated Rules types
18 lines
427 B
Go
18 lines
427 B
Go
package rules
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/titpetric/factory"
|
|
)
|
|
|
|
type ResourcesInterface interface {
|
|
With(ctx context.Context, db *factory.DB) ResourcesInterface
|
|
|
|
CheckAccessMulti(resource string, operation string) error
|
|
CheckAccess(resource string, operation string) error
|
|
|
|
Grant(resource string, teamID uint64, operations []string, value Access) error
|
|
ListGrants(resource string, teamID uint64) ([]Rules, error)
|
|
}
|