@@ -16,15 +16,24 @@ func (q *AuthzQuerier) GetLicenses(ctx context.Context) ([]database.License, err
16
16
}
17
17
18
18
func (q * AuthzQuerier ) InsertLicense (ctx context.Context , arg database.InsertLicenseParams ) (database.License , error ) {
19
- return insertWithReturn (q .log , q .auth , rbac .ResourceLicense , q .db .InsertLicense )(ctx , arg )
19
+ if err := q .authorizeContext (ctx , rbac .ActionCreate , rbac .ResourceLicense ); err != nil {
20
+ return database.License {}, err
21
+ }
22
+ return q .db .InsertLicense (ctx , arg )
20
23
}
21
24
22
25
func (q * AuthzQuerier ) InsertOrUpdateLogoURL (ctx context.Context , value string ) error {
23
- return insert (q .log , q .auth , rbac .ResourceDeploymentConfig , q .db .InsertOrUpdateLogoURL )(ctx , value )
26
+ if err := q .authorizeContext (ctx , rbac .ActionCreate , rbac .ResourceDeploymentConfig ); err != nil {
27
+ return err
28
+ }
29
+ return q .db .InsertOrUpdateLogoURL (ctx , value )
24
30
}
25
31
26
32
func (q * AuthzQuerier ) InsertOrUpdateServiceBanner (ctx context.Context , value string ) error {
27
- return insert (q .log , q .auth , rbac .ResourceDeploymentConfig , q .db .InsertOrUpdateServiceBanner )(ctx , value )
33
+ if err := q .authorizeContext (ctx , rbac .ActionCreate , rbac .ResourceDeploymentConfig ); err != nil {
34
+ return err
35
+ }
36
+ return q .db .InsertOrUpdateServiceBanner (ctx , value )
28
37
}
29
38
30
39
func (q * AuthzQuerier ) GetLicenseByID (ctx context.Context , id int32 ) (database.License , error ) {
0 commit comments