Add /api/v2/deployment/stats to Members access
- Dominant language
- Go
- Stars
- 14.5k
- Forks
- 1.5k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 601
Description
Seems that Members dont have access to endpoint `/api/v2/deployment/stats` which blocks the possibility to display Coder WS stats on the UI

```
2024-11-04 19:26:12.267 [warn] coderd: requester is not authorized to access the object internal_error= request_id=b887dc8e-504a-4365-
9aad-d996e3c22d90 roles="[member organization-member:3f784827-371b-49d0-8c29-9f8a72b79f7f]" actor_id=f7747fab-f5b4-4dea-b434-
a51cbaad9a66 actor_name={"FriendlyName":"xxx","ID":"f7747fab-f5b4-4dea-b434-a51cbaad9a66","Roles":
[{"name":"member","display_name":"Member","site":[{"negate":false,"resource_type":"assign_role","action":"read"},
{"negate":false,"resource_type":"oauth2_app","action":"read"},{"negate":false,"resource_type":"provisioner_daemon","action":"read"},
{"negate":false,"resource_type":"workspace_proxy","action":"read"}],"org":{},"user":[{"negate":false,"resource_type":"api_key","action":"*"},
{"negate":false,"resource_type":"assign_org_role","action":"*"},{"negate":false,"resource_type":"assign_role","action":"*"},
{"negate":false,"resource_type":"audit_log","action":"*"},{"negate":false,"resource_type":"debug_info","action":"*"},
{"negate":false,"resource_type":"deployment_config","action":"*"},{"negate":false,"resource_type":"deployment_stats","action":"*"},
{"negate":false,"resource_type":"file","action":"*"},{"negate":false,"resource_type":"group","action":"*"},
{"negate":false,"resource_type":"group_member","action":"*"},{"negate":false,"resource_type":"license","action":"*"},
{"negate":false,"resource_type":"notification_preference","action":"*"},{"negate":false,"resource_type":"notification_template","action":"*"},
{"negate":false,"resource_type":"oauth2_app","action":"*"},{"negate":false,"resource_type":"oauth2_app_code_token","action":"*"},
{"negate":false,"resource_type":"oauth2_app_secret","action":"*"},{"negate":false,"resource_type":"organization","action":"*"},
{"negate":false,"resource_type":"provisioner_daemon","action":"*"},{"negate":false,"resource_type":"provisioner_keys","action":"*"},
{"negate":false,"resource_type":"replicas","action":"*"},{"negate":false,"resource_type":"system","action":"*"},
{"negate":false,"resource_type":"tailnet_coordinator","action":"*"},{"negate":false,"resource_type":"template","action":"*"},
{"negate":false,"resource_type":"workspace","action":"*"},{"negate":false,"resource_type":"workspace_proxy","action":"*"},
{"negate":false,"resource_type":"provisioner_daemon","action":"read"},{"negate":false,"resource_type":"provisioner_daemon","action":"create"},
{"negate":false,"resource_type":"provisioner_daemon","action":"read"},{"negate":false,"resource_type":"provisioner_daemon","action":"update"},
{"negate":false,"resource_type":"user","action":"read"},{"negate":false,"resource_type":"user","action":"read_personal"},
{"negate":false,"resource_type":"user","action":"update_personal"},{"negate":false,"resource_type":"workspace_dormant","action":"read"},
{"negate":false,"resource_type":"workspace_dormant","action":"delete"},{"negate":false,"resource_type":"workspace_dormant","action":"create"},
{"negate":false,"resource_type":"workspace_dormant","action":"update"},{"negate":false,"resource_type":"workspace_dormant","action":"stop"}]},
{"name":"organization-member:3f784827-371b-49d0-8c29-9f8a72b79f7f","display_name":"","site":[],"org":{"3f784827-371b-49d0-8c29-9f8a72b79f7f":
[{"negate":false,"resource_type":"organization","action":"read"},{"negate":false,"resource_type":"assign_org_role","action":"read"}]},"user":
[{"negate":false,"resource_type":"organization_member","action":"read"}]}],"Groups":null,"Scope":"all"} scope=all route=/api/v2/deployment/stats
action=read object={"id":"","owner":"","org_owner":"","any_org":false,"type":"deployment_stats","acl_user_list":null,"acl_group_list":null}
```
Users without admin powers:

Contributor guide
Assessment
This issue has not been assessed yet.