Signature
TSsignature
function useAllowedAPIPermission(): () => AllowedAPIPermissionStore;
// APINames value: 'allowed-api-permission'Key API
- checkIsAllowAPI(apiName) — whether the signed-in role may call an API
- Cache is filled by the shell after login / permission refresh
- Works with <Protected requiredApis={[…]}> from the permission system
Usage
TSXcheck
import { useAllowedAPIPermission } from "@quan-erp/base-frontend";
const permission = useAllowedAPIPermission()();
const canCreate = permission.checkIsAllowAPI("my-plugin.create");Notes
- Double-call required
- Prefer <Protected> for UI gating when possible
- See Frontend → Core → Role and permissions for the full RBAC model