Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Permissions API Service for feature access control
Summary
Introduces a new
PermissionsApiServiceto query user feature permissions from the backend, enabling fine-grained access control for features like AI models, storage limits, and wallet capabilities.Changes
New API Service (
libs/remix-api/src/lib/plugins/api-services.ts)PermissionsApiServiceclass with methods:getPermissions()- Get all user permissionscheckFeature(feature)- Check single feature accesscheckFeatures(features)- Batch check multiple featuresgetFeaturesInCategory(category)- Get features by categoryhasFeature(feature)- Simple boolean helpergetFeatureLimit(feature)- Get limit value/unit for a featureNew Types (
libs/remix-api/src/lib/plugins/api-types.ts)Permission,PermissionsResponse,FeatureCheckResponse,MultiFeatureCheckResponse,CategoryFeaturesResponseAuthPlugin Integration (
apps/remix-ide/src/app/plugins/auth-plugin.tsx)checkPermission(feature)- Check feature with limitshasPermission(feature)- Simple boolean checkgetAllPermissions()- Get all user permissionscheckPermissions(features)- Batch checkgetFeaturesByCategory(category)- Category-based queriesgetFeatureLimit(feature)- Get limits onlyRefactoring
setToken()method to all API service classes for proper encapsulation (removesas anycasts)@remix-endpoints-helperUsage Examples
Real-world integration example