Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk3 min

Permission-Access: Map Backend Permission Strings to UI Actions

Alaa Samy’s permission-access uses an optional action map to translate endpoint-shaped backend permission strings into UI checks such as can the user read Orders?

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

permission-access is a small JavaScript library Alaa Samy describes for translating backend permission names into checks the UI can express as resource-and-action questions, such as whether someone can read Orders. In Samy’s account, the backend returned endpoint-shaped strings like Orders.GetAll_GET, while the dashboard needed to ask a semantic question. An optional action map bridges those vocabularies; without one, checks use literal permission names such as Orders.read.

Why endpoint-shaped permission strings were awkward in the UI

Samy describes building an internal admin dashboard with Next.js and Redux. Its backend permissions were named after endpoints—for example, Orders.GetAll_GET and Orders.Create_POST—rather than straightforward resource/action pairs such as orders.read.

As an Amazon Associate I earn from qualifying purchases.

That meant UI code had to know the backend’s naming. In Samy’s example, the dashboard needed to answer questions such as “can they read Orders?” If checks tied to backend identifiers were repeated across modules, a backend rename could be difficult to catch. His reference to checks appearing in “forty places” is an anecdote about that dashboard, not a measured industry statistic.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Samy describes the goal as letting the UI ask a semantic question without hardcoding the endpoint name chosen by the backend. The account is about UI checks; it does not establish that hiding or showing a control enforces authorization on the server.

How the action map translates the two naming schemes

The central mechanism is an optional action map: it associates a UI-level action with one or more backend permission suffixes. In Samy’s example, read maps to suffixes such as GetAll_GET and GetList_GET. A call like checker.can("Orders", "read") can then check against a permission such as Orders.GetAll_GET.

Omit the map and, as the article describes it, the checker looks for the literal permission Orders.read. Samy also identifies REST_ACTION_MAP as an available REST-shaped preset; it is opt-in, not an assumed default. The choice is therefore between explicitly adapting backend-specific names and using literal semantic permission strings.

What the documented APIs look like

Samy presents a framework-agnostic core and a separate React-facing API. The following are examples from his article, not independently tested results.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Non-React checks

The core example uses createAccessChecker. Samy also shows convenience checks such as canRead, canCreate, and canUpdate, alongside the general can check. These let application code ask about an action without embedding endpoint suffixes at each call site.

React integration

For React, the documented interface includes PermissionsProvider, usePermissions, and a <Can> component. Samy’s example uses the component to render fallback content when a requested action is unavailable. These APIs address what the UI renders; they should not be treated as a replacement for server-side authorization.

What the library does not claim to handle

In the article’s publication context, Samy describes the package as version 0.1.x and says it had not been battle-tested outside his project. That is a historical description, not confirmation of the package’s current version, maintenance, or maturity.

  • The documented checks return booleans; Samy says there is no explanation of why a permission was denied.
  • He says the library does not provide wildcard permissions or feature flags.
  • A discussion reply says it expects a flat, already-resolved permission list rather than resolving roles itself.
  • Samy says there is no attribute-based access control (ABAC) support at that time.

These are the author’s stated scope and limitations at publication, not an independent security review or confirmation of current package behavior. The article does not establish production reliability or server-side enforcement properties.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Where permission-access fits

The library’s narrow purpose is to keep UI checks readable when permission strings are shaped around backend endpoints. Its action map is useful when an application wants calls such as “can read Orders?” while retaining backend-specific permission identifiers. If the permission list already uses literal resource/action names, the article’s described checker can be used without a map. The account does not compare this approach with other libraries or establish that the mismatch is common across software projects.

Source: Alaa Samy’s article and discussion on DEV Community.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.