Accessly Permissions

    1

    Add RBAC, permission checks, feature flags and filtered navigation to React and Next.js UIs with accessly.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    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

    1. Ensure the PermissionProvider in your root layout includes the posts.delete string or an admin role that expands to it.
    2. Verify that the deletePostAction also performs a server-side permission check for security.
    3. If you need to explain why the button is missing during debugging, swap <Can> for the useAccessDecision hook.

    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

    1. Initialize the provider by wrapping your root layout with the current user's roles, permissions, and feature flags.
    2. Define role maps to expand high-level roles like 'admin' into granular dot-notated permission strings.
    3. Protect components using hooks or components for simple boolean checks or complex 'all/any' logic.
    4. 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.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.

    Authorization only, not for accessibility (a11y). No support for ABAC conditions. Always requires secondary enforcement on the server.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    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 to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 25 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Listed25 days ago

    What's inside

    Frequently Asked Questions

    This skill centralizes authorization logic, preventing the "if-statement spaghetti" that occurs when hardcoding permission checks. It provides a standardized way to handle RBAC, feature flags, and UI gating specifically for React and Next.js environments.

    The skill is optimized for React 18+ and Next.js, including full support for the App Router. It leverages the Accessly library to handle permissions in both Client Components and Server Components/Middleware.

    You receive the complete implementation logic for integrating Accessly, including specialized components for UI gating, route guards, and a provider setup that maps user roles to granular permissions.

    No, this skill focuses on the frontend authorization layer (RBAC and feature flags). You must still secure your backend API endpoints independently, as this skill does not replace server-side security logic.

    The skill includes a 'Permission Debugging' workflow that allows you to log and inspect access decisions, helping you quickly identify whether a user is missing a specific permission string or a feature flag.

    New in Frontend & Web Apps

    Free