Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands console permission evaluation and adjusts the browser buckets page so “Object Count” / “Size” columns can be shown even when the user can’t access the underlying usage endpoint (handling 403s locally instead of via the global redirect).
Changes:
- Extend
ConsoleStatementparsing/evaluation to supportNotActionand relaxActionto optional, plus add console-scope resource handling logic. - Add a per-request API client option to suppress the global 403 handler and throw instead.
- Update the buckets browser page to always request bucket usage and render placeholders (
"--") when usage data can’t be fetched.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| lib/console-policy-parser.ts | Adds NotAction support and modifies action/resource matching for console scopes. |
| lib/api-client.ts | Introduces suppress403Redirect to bypass the global 403 handler and throw an error. |
| hooks/use-system.ts | Uses suppress403Redirect for /datausageinfo requests. |
| app/(dashboard)/browser/page.tsx | Always shows Object Count/Size columns and avoids populating 0-values when usage can’t be fetched. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, | ||
| [isAdmin, listBuckets, loadBucketUsage], | ||
| [listBuckets, loadBucketUsage], | ||
| ) |
There was a problem hiding this comment.
After removing isAdmin from the hook dependency arrays, isAdmin (and useAuth) appears to be unused in this component, which will trigger no-unused-vars during lint/typecheck. Consider removing the useAuth import and const { isAdmin } = useAuth() if it’s no longer needed.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@copilot fix conflicts |
|
@GatewayJ 处理一下冲突 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0a85122 to
f5b3c98
Compare
ok了 ,done it |
Pull Request
Description
Type of Change
Testing
Checklist
Related Issues
Closes #
Screenshots (if applicable)
Additional Notes