Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate helpers in ServicePermissions #193

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add IsChargeable
majst01 committed Mar 3, 2025
commit e79e4336948f5d837a47ffa70595faf760bbea88
5 changes: 5 additions & 0 deletions generate/go_servicepermissions.tpl
Original file line number Diff line number Diff line change
@@ -114,6 +114,11 @@ func IsProjectScope(req connect.AnyRequest) bool {
return ok
}

func IsChargeableScope(req connect.AnyRequest) bool {
_, ok := GetServicePermissions().Chargeable[req.Spec().Procedure]
return ok
}

func GetTenantFromRequest(req connect.AnyRequest) (string, bool) {
if !IsTenantScope(req) {
return "", false
5 changes: 5 additions & 0 deletions go/permissions/servicepermissions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.