Require auth for most methods

This commit is contained in:
2021-12-07 06:51:14 +01:00
parent 5fcf09f160
commit 34421e082f
4 changed files with 221 additions and 176 deletions

View File

@@ -81,3 +81,9 @@ func UserIDFromContext(ctx context.Context) string {
}
return ""
}
func RoleAtLeast(ctx context.Context, role pb.User_Role) bool {
ctxRole := RoleFromContext(ctx)
return ctxRole > role
}