RBAC: Initiate store in service (#55081)

* RBAC: Dont inject store with wire

* RBAC: Use Store interface

* RBAC: Move store interface and initiate it from service
This commit is contained in:
Karl Persson
2022-09-15 11:34:15 +02:00
committed by GitHub
parent aabd626403
commit b827df626d
7 changed files with 16 additions and 22 deletions

View File

@@ -45,12 +45,6 @@ type Options struct {
ReloadCache bool
}
type Store interface {
// GetUserPermissions returns user permissions with only action and scope fields set.
GetUserPermissions(ctx context.Context, query GetUserPermissionsQuery) ([]Permission, error)
DeleteUserPermissions(ctx context.Context, orgID, userID int64) error
}
type TeamPermissionsService interface {
GetPermissions(ctx context.Context, user *user.SignedInUser, resourceID string) ([]ResourcePermission, error)
SetUserPermission(ctx context.Context, orgID int64, user User, resourceID, permission string) (*ResourcePermission, error)