- Home
- Skills
- Frontend & Web Apps
- Accessly Permissions
Accessly Permissions
Add RBAC, permission checks, feature flags and filtered navigation to React and Next.js UIs with accessly.
Free
Works with the AI Agents you already use
Accessly Permissions
Example session with this skill installed
Add a delete button to the Post component that only shows for users with 'posts.delete' permission, otherwise show nothing.
- Read your context and instructions
- Compiled the accessly permissions
I have implemented the permission-gated delete button using the Can component from accessly.
Implementation Details
"use client";
import React from "react";
import { Can } from "accessly";
import { deletePostAction } from "@/actions/posts";
interface PostDeleteButtonProps {
postId: string;
}
export function PostDeleteButton({ postId }: PostDeleteButtonProps) {
const handleDelete = async () => {
const confirmed = window.confirm("Are you sure you want to delete this post?");
if (confirmed) {
await deletePostAction(postId);
}
};
return (
<Can
permission="posts.delete"
fallback={null}
>
<button
onClick={handleDelete}
className="px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 transition-colors"
>
Delete Post
</button>
</Can>
);
}
Next steps
- Ensure the
PermissionProviderin your root layout includes theposts.deletestring or anadminrole that expands to it. - Verify that the
deletePostActionalso performs a server-side permission check for security. - If you need to explain why the button is missing during debugging, swap
<Can>for theuseAccessDecisionhook.
Connects securely to your tools. The creator never sees your data.
About this skill
Hardcoding permission checks into UI components leads to messy, unmaintainable codebases. This skill implements the Accessly library to centralize role-based access control (RBAC), feature flags, and gated navigation in React and Next.js applications.
What it does
- Implement RBAC by wrapping apps in a provider that resolves roles into specific permissions.
- Gate UI elements using declarative components to show, hide, or disable buttons and sections.
- Route protection via layout-level guards that handle loading states and fallback UI.
- Filtered navigation by automatically removing menu items a user is not authorized to see.
- Permission debugging using access decisions that explain exactly why a resource was allowed or denied.
How it works
- Initialize the provider by wrapping your root layout with the current user's roles, permissions, and feature flags.
- Define role maps to expand high-level roles like 'admin' into granular dot-notated permission strings.
- Protect components using hooks or components for simple boolean checks or complex 'all/any' logic.
- Debug denials by logging formatted access decisions to identify missing flags or permissions.
Frameworks & tools
Specifically designed for React and Next.js projects. It uses the accessly npm package for frontend authorization and accessly/core for logic in Server Components or middleware.
Why this beats prompting it yourself
Prompting often results in inconsistent "if-statements" scattered across components. This skill ensures a normalized authorization model, correct wildcard handling, and zero-dependency performance without the overhead of heavy policy engines.
Use cases
- Hide "Delete" buttons for users without specific owner or admin permissions.
- Toggle beta functionality based on feature flag values from your backend.
- Filter a sidebar navigation array to only show accessible dashboard links.
- Implement a "Manager Only" page guard in a Next.js App Router layout.
Known limitations
This handles frontend authorization only. It does not replace server-side API protection or support attribute-based access control (ABAC) with complex conditions.
Source and latest version: https://github.com/Mostafashadow1/agent-skills (MIT licensed, free). npm: https://www.npmjs.com/package/accessly · Docs: https://accessly-website.vercel.app/. Author: Mostafa Shadow.
Authorization only, not for accessibility (a11y). No support for ABAC conditions. Always requires secondary enforcement on the server.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 25 days ago
- Free with an Agensi account