mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
feat: Implement RBAC checks on /templates endpoints (#1678)
* feat: Generic Filter method for rbac objects
This commit is contained in:
15
coderd/rbac/fake_test.go
Normal file
15
coderd/rbac/fake_test.go
Normal file
@ -0,0 +1,15 @@
|
||||
package rbac_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/coder/coder/coderd/rbac"
|
||||
)
|
||||
|
||||
type fakeAuthorizer struct {
|
||||
AuthFunc func(ctx context.Context, subjectID string, roleNames []string, action rbac.Action, object rbac.Object) error
|
||||
}
|
||||
|
||||
func (f fakeAuthorizer) ByRoleName(ctx context.Context, subjectID string, roleNames []string, action rbac.Action, object rbac.Object) error {
|
||||
return f.AuthFunc(ctx, subjectID, roleNames, action, object)
|
||||
}
|
Reference in New Issue
Block a user