weebi_users library
Classes
- AccessTokenObject
- Simple data holder for access token value
- AccessTokenProvider
- Provider for managing access token state
- AuthInterceptor
- gRPC interceptor for adding JWT authentication headers
- AuthService
- Concrete auth service implementation using secure storage
- AuthServiceAbstract
- Abstract auth service class (kept for backward compatibility)
- AuthServiceNoPersistence
- No-persistence auth service for testing
- BusinessRulesSettingsSection
- Lifetime-licence–gated business rules block for boutique/chain forms in the portal.
- BusinessRulesSettingsSectionState
- BusinessRulesUiStrings
- French UI copy for boutique/chain business rules (portal settings).
- CompactPermissionsWidget
- CreatedUserResult
- Result of UserProvider.createUser: the saved user plus the one-time plaintext password (never stored after this call).
-
DynamicBody<
T extends GeneratedMessage> - DynamicPermissionsAnalyzer
- Dynamic permissions analyzer using protobuf runtime reflection
- EditablePermissionWidget
- Enhanced editable version of the PermissionWidget from the auth package
- ElegantPermissionsWidget
- An elegant widget for displaying and editing user permissions with inline controls
-
EndpointBase<
T, R> - Base interface for RPC endpoints
- EntitlementUiStrings
- French UI copy for licence attribution and portal entitlements.
- FenceServiceClientProviderV2
-
Provides a
FenceServiceClientthat is recreated when the access token changes. Uses a factory so the host app can supply its own channel (grpc or grpc_web). - FirmLicenseSeatSummary
- Seat counts for currently valid licenses (same rules as server operational gate).
- FreemiumDumpQuotaError
- Parsed freemium dump-quota denial from a gRPC error message.
- JsonWebToken
- JWT token parser and utility class
- JsonWebTokenWrapper
- Wrapper class for JWT token to trigger proxy provider updates
- LicenseSeatClient
-
Low-level licence attribution validity (mirrors server
LicenseSeatEntitlement). - LicenseSeatStatusCard
- Shows whether userId has an active attributed licence on licenses.
- PermissionProvider
- Provider for managing user permissions from JWT token Single source of truth for permissions - reads from AccessTokenProvider
- PermissionsHelper
- Helper class for checking user permissions
- PermissionsUiStrings
-
French labels for permission sections and rows (
elegant_permissions_widget, chips). - PermissionWidget
- Widget for displaying a permission with checkbox
-
PersistedTokenProvider<
A extends AuthServiceAbstract> - Provider for managing persisted tokens using AuthService
- ProtobufFieldWidget
- ReadAccessTokenAbstractRpc
- Abstract class for reading access tokens
- ReadAccessTokenFakeRpc
- Fake implementation for testing
- ReadAccessTokenRpc
- Concrete implementation for reading access tokens using secure storage
- ReadRefreshTokenAbstractRpc
- Abstract class for reading refresh tokens
- ReadRefreshTokenFakeRpc
- Fake implementation for testing
- ReadRefreshTokenRpc
- Concrete implementation for reading refresh tokens using secure storage
- RequestLogInterceptor
- SeatCapability
- Portal capabilities that require an attributed lifetime licence (no firm-creator joker).
- UpsertAccessTokenAbstractRpc
- Abstract class for upserting access tokens
- UpsertAccessTokenFakeRpc
- Fake implementation for testing
- UpsertAccessTokenRpc
- Concrete implementation for upserting access tokens using secure storage
- UpsertRefreshTokenAbstractRpc
- Abstract class for upserting refresh tokens
- UpsertRefreshTokenFakeRpc
- Fake implementation for testing
- UpsertRefreshTokenRpc
- Concrete implementation for upserting refresh tokens using secure storage
- UserCreateView
-
Admin creates a pending user already linked to the creator's firm
(
UserPermissions.firmIdfrom the access token). The invitee then signs up. - UserDetailWidget
- Widget to display user details (buttons are handled by parent scaffold)
- UserFormWidget
- Widget for creating or editing a user
- UserListWidget
- User list widget that automatically generates UI using protobuf mirroring
- UserProvider
- Provider class for managing user state and permissions
- UserRoutes
- Route factory for user management Provides clean route builders that client apps can integrate
- UserUiStrings
-
French UI strings for
users_weebi(default locale).
Extensions
- UserPermissionsExtension on UserPermissions
- Extension methods for the UserPermissions protobuf class to provide convenient access and formatting of user permissions
- UserPermissionsX on UserPermissions
- Convenience extension to query CRUD and boolean permissions
- UserPublicExtension on UserPublic
- Extension methods for the UserPublic protobuf class to provide convenient access and formatting of user data
Constants
- kFreemiumFullDumpQuotaExceeded → const String
-
Stable substring in gRPC error messages for freemium full-dump quota.
Must stay in sync with server
kFreemiumFullDumpQuotaExceeded.
Functions
-
accessTokenMarksFirmCreator(
AccessTokenProvider access) → bool -
True when the JWT carries
isFirmCreator(works beforeUserPermissionsexposes the field). -
applyBusinessRulesToForm(
{required BusinessRules rules, required void setNegativeStockGuard(bool negativeStockGuard), required void setRecentTicketEdit(bool negativeStockGuard), required void setWindowMinutesText(String windowMinutesText)}) → void -
Applies
rulesto form state used by create/edit screens. -
buildBusinessRulesFromForm(
{required bool negativeStockGuardEnabled, required bool recentTicketEditEnabled, required String recentTicketEditWindowMinutesText}) → BusinessRules -
firmCreatorOperationalJoker(
UserPermissions permissions) → bool -
Matches server
firmCreatorOperationalJokerinentitlement_helpers.dart: the firm creator may use a narrow operational preview path without an attributed licence. This is not a lifetime licence and does not cover licence-gated portal features. Seedocs/commercial-model.md(no subscriptions). -
initCrossRoutesTestV2(
Widget home, {required FenceServiceClientFactory createFenceClient, required String initialAccessToken}) → MultiProvider -
Demo/test helper: builds a provider tree with auth + fence + user providers.
The host app must supply
createFenceClient(e.g. using GrpcWebClientChannel for web). -
isLicenseCurrentlyValid(
License license, {DateTime? now}) → bool -
Whether
licenseis within its global validity window. -
requireFirmIdFromAccessToken(
String token) → String -
Extracts
UserPermissions.firmIdfrom a bearer JWT. -
summarizeFirmLicenseSeats(
Iterable< License> licenses, {DateTime? now}) → FirmLicenseSeatSummary -
Aggregates capacity and assigned seats for valid licenses at
now. -
userHasActiveLicensedSeat(
String userId, Iterable< License> licenses, {DateTime? now}) → bool -
True if
userIdhas at least one active seat on a currently valid license.
Typedefs
- FenceServiceClientFactory = FenceServiceClient Function(String accessToken)
-
Callback that creates a
FenceServiceClientwith the given access token. The host app provides this so it can use its own channel (e.g. GrpcWebClientChannel for web).