Approval does not automatically protect custom backend endpoints
Source references: 5The mixin supplies approval-management endpoints, but `isCallerApproved()` is only for frontend UI gating. Every custom public backend function still needs its own server-side approval or authorization check.
If an application only hides frontend features and omits backend checks, an unapproved user may directly invoke public endpoints and perform supposedly protected actions.
The candidate correctly identifies an integration boundary: the mixin exposes approval-management endpoints but does not automatically enforce approval on application-specific backend endpoints. The migration guide explicitly says `isCallerApproved()` is only for frontend UI gating and requires canister-side guards to remain. If a developer only hides frontend features without checking approval or admin permission in each custom public function, an unapproved caller may still invoke backend functionality directly. Users should ask the author to confirm that every sensitive custom endpoint has a server-side guard and verify this with direct backend-call tests.
IMPORTANT: Apply the right authorization and/or approval check to each custom public function.Show 4 other places
# User Approval Flow- Check approval status (`isCallerApproved`)- If not approved, show option to request approval (`requestApproval`)- Block access to main features for non-approved users- Admins have access to all features of the application- Display approval status clearly in the UICustom endpoints that guard on approval status continue to use the top-level `approvalState`:```motokopublic shared ({ caller }) func protectedFeature() : async () { if (not (UserApproval.isApproved(approvalState, caller) or AccessControl.hasPermission(accessControlState, caller, #admin))) { Runtime.trap("Unauthorized: Only approved users can perform this action"); };};```Keep these canister-side guards. The mixin-provided `isCallerApproved()` is a public query for frontend UI gating only; it does not enforce approval on custom backend endpoints.Keep these canister-side guards. The mixin-provided `isCallerApproved()` is a public query for frontend UI gating only; it does not enforce approval on custom backend endpoints.- [ ] Remove the four mixin-provided functions from `main.mo` and any custom mixins (keep top-level `UserApproval.initState(...)`)- [ ] Update any custom approval guards to use the top-level `approvalState`. Do not replace them with a frontend `isCallerApproved()` check- [ ] Run `mops install`, `mops build`, and `mops lint`