Repository navigation
feat(labrinth): staff PAT scopes - #8241
Conversation
Pull request changelogAppAddedChangedDeprecatedRemovedFixedSecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
[High impact] Credential scopes now shape access across staff tools and many API workflows. Fix the two project read checks before merging so read-only staff PATs work without write access. Reviews (3) · Last reviewed commit: "fix: let ADMIN_READ view analytics for a..." · Reviewed by Greptile |
|
mmm yeah admin scope should always include moderator scopes |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: François-Xavier Talbot <108630700+fetchfern@users.noreply.github.com>
This reverts commit 0c96d8e.
Comments Outside DiffThese findings could not be posted inline.
|
# Conflicts: # apps/labrinth/src/routes/v3/reports.rs
| pub fn into_user(self) -> User { | ||
| self.user | ||
| } | ||
|
|
||
| pub fn to_user(&self) -> User { | ||
| self.user.clone() | ||
| } | ||
|
|
||
| /// Whether the credentials grant all of `scopes`. | ||
| pub fn has_scopes(&self, scopes: Scopes) -> bool { | ||
| self.scopes.contains(scopes) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
user, scopes are public fields already. Not much point in hiding these behind into_ and to_ accessors,
user.to_user().foo()->user.user.foo()user.has_scopes(Scopes::SOMETHING)->user.scopes.contains(Scopes::SOMETHING)
|
Queue requested — the merge queue status continues in this comment ↓. |
# Conflicts: # apps/labrinth/src/routes/internal/billing.rs
✅ Merged into
|
No description provided.