Skip to content

Commit 3fff52a

Browse files
committed
Iter
1 parent 35995ff commit 3fff52a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

integrations/authorization/v1/definition/types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ import (
2828
)
2929

3030
var (
31-
actionNameRE = regexp.MustCompile(`^[a-z]+(\.[a-z]+)*$`)
31+
actionName = `^[a-z_]+(\.[a-z_]+)*$`
32+
actionNameRE = regexp.MustCompile(actionName)
3233
)
3334

3435
func validateActionName(name string) error {
3536
if !actionNameRE.MatchString(name) {
36-
return errors.Errorf("Action `%s` does not match the regex", name)
37+
return errors.Errorf("Action `%s` does not match the regex `%s`", name, actionName)
3738
}
3839

3940
return nil

pkg/permissions/shared/storage.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ type Storage interface {
4848
AssignUserToPolicy(ctx context.Context, user, policy string) error
4949
DetachUserFromPolicy(ctx context.Context, user, policy string) error
5050

51+
UserRoles(ctx context.Context, name string) ([]*pbAuthorizationV1.AuthorizationV1Role, error)
52+
AssignUserToRole(ctx context.Context, user, role string) error
53+
DetachUserFromRole(ctx context.Context, user, role string) error
54+
5155
GetPolicy(ctx context.Context, name string) (*pbAuthorizationV1.AuthorizationV1Policy, error)
5256
GetPolicies(ctx context.Context) ([]*pbAuthorizationV1.AuthorizationV1Policy, error)
5357
DeletePolicy(ctx context.Context, name string) error

0 commit comments

Comments
 (0)