@@ -94,10 +94,6 @@ func (r *Runner) CreateRepository(ctx context.Context, param params.CreateRepoPa
9494}
9595
9696func (r * Runner ) ListRepositories (ctx context.Context , filter params.RepositoryFilter ) ([]params.Repository , error ) {
97- if ! auth .IsAdmin (ctx ) {
98- return nil , runnerErrors .ErrUnauthorized
99- }
100-
10197 repos , err := r .store .ListRepositories (ctx , filter )
10298 if err != nil {
10399 return nil , fmt .Errorf ("error listing repositories: %w" , err )
@@ -107,10 +103,6 @@ func (r *Runner) ListRepositories(ctx context.Context, filter params.RepositoryF
107103}
108104
109105func (r * Runner ) GetRepositoryByID (ctx context.Context , repoID string ) (params.Repository , error ) {
110- if ! auth .IsAdmin (ctx ) {
111- return params.Repository {}, runnerErrors .ErrUnauthorized
112- }
113-
114106 repo , err := r .store .GetRepositoryByID (ctx , repoID )
115107 if err != nil {
116108 return params.Repository {}, fmt .Errorf ("error fetching repository: %w" , err )
@@ -277,10 +269,6 @@ func (r *Runner) CreateRepoPool(ctx context.Context, repoID string, param params
277269}
278270
279271func (r * Runner ) GetRepoPoolByID (ctx context.Context , repoID , poolID string ) (params.Pool , error ) {
280- if ! auth .IsAdmin (ctx ) {
281- return params.Pool {}, runnerErrors .ErrUnauthorized
282- }
283-
284272 entity := params.ForgeEntity {
285273 ID : repoID ,
286274 EntityType : params .ForgeEntityTypeRepository ,
@@ -325,9 +313,6 @@ func (r *Runner) DeleteRepoPool(ctx context.Context, repoID, poolID string) erro
325313}
326314
327315func (r * Runner ) ListRepoPools (ctx context.Context , repoID string ) ([]params.Pool , error ) {
328- if ! auth .IsAdmin (ctx ) {
329- return []params.Pool {}, runnerErrors .ErrUnauthorized
330- }
331316 entity := params.ForgeEntity {
332317 ID : repoID ,
333318 EntityType : params .ForgeEntityTypeRepository ,
@@ -340,10 +325,6 @@ func (r *Runner) ListRepoPools(ctx context.Context, repoID string) ([]params.Poo
340325}
341326
342327func (r * Runner ) ListPoolInstances (ctx context.Context , poolID string , outdatedOnly bool ) ([]params.Instance , error ) {
343- if ! auth .IsAdmin (ctx ) {
344- return nil , runnerErrors .ErrUnauthorized
345- }
346-
347328 instances , err := r .store .ListPoolInstances (ctx , poolID , outdatedOnly )
348329 if err != nil {
349330 return []params.Instance {}, fmt .Errorf ("error fetching instances: %w" , err )
@@ -399,9 +380,6 @@ func (r *Runner) UpdateRepoPool(ctx context.Context, repoID, poolID string, para
399380}
400381
401382func (r * Runner ) ListRepoInstances (ctx context.Context , repoID string ) ([]params.Instance , error ) {
402- if ! auth .IsAdmin (ctx ) {
403- return nil , runnerErrors .ErrUnauthorized
404- }
405383 entity := params.ForgeEntity {
406384 ID : repoID ,
407385 EntityType : params .ForgeEntityTypeRepository ,
@@ -473,10 +451,6 @@ func (r *Runner) UninstallRepoWebhook(ctx context.Context, repoID string) error
473451}
474452
475453func (r * Runner ) GetRepoWebhookInfo (ctx context.Context , repoID string ) (params.HookInfo , error ) {
476- if ! auth .IsAdmin (ctx ) {
477- return params.HookInfo {}, runnerErrors .ErrUnauthorized
478- }
479-
480454 repo , err := r .store .GetRepositoryByID (ctx , repoID )
481455 if err != nil {
482456 return params.HookInfo {}, fmt .Errorf ("error fetching repo: %w" , err )
0 commit comments