npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@memberjunction/ng-resource-permissions

v5.37.0

Published

MemberJunction: Generic Angular components for displaying/editing permissions for a resource

Readme

@memberjunction/ng-resource-permissions

Angular components for managing resource-level permissions in MemberJunction applications. Provides interfaces for viewing, granting, editing, and revoking permissions for any resource type, viewing available resources, and requesting access to restricted resources.

Installation

npm install @memberjunction/ng-resource-permissions

Overview

The resource permissions package provides three components that together form a complete permission management workflow: managing who can access a resource and at what level, viewing which resources a user has access to, and requesting access to restricted resources. All permission changes are grouped in transactions for data integrity.

flowchart TD
    subgraph Manage["Permission Management"]
        A["ResourcePermissionsComponent"]
        A --> B["Add User/Role Permission"]
        A --> C["Edit Permission Level"]
        A --> D["Remove Permission"]
    end
    subgraph View["Resource Browsing"]
        E["AvailableResourcesComponent"]
        E --> F["Filtered Resource Grid"]
    end
    subgraph Request["Access Request"]
        G["RequestResourceAccessComponent"]
        G --> H["Submit Access Request"]
    end
    subgraph Engine["Permission Engine"]
        I["ResourcePermissionEngine"]
    end

    A --> I
    E --> I
    G --> I

    style Manage fill:#2d6a9f,stroke:#1a4971,color:#fff
    style View fill:#7c5295,stroke:#563a6b,color:#fff
    style Request fill:#2d8659,stroke:#1a5c3a,color:#fff
    style Engine fill:#b8762f,stroke:#8a5722,color:#fff

Usage

Module Import

import { ResourcePermissionsModule } from '@memberjunction/ng-resource-permissions';

@NgModule({
  imports: [ResourcePermissionsModule]
})
export class YourModule {}

Managing Permissions

<mj-resource-permissions
  [ResourceTypeID]="reportResourceTypeID"
  [ResourceRecordID]="reportID"
  [ShowSaveButton]="true"
  [AllowAddPermissions]="true"
  [AllowEditPermissions]="true"
  [AllowDeletePermissions]="true"
  [PermissionLevels]="['View', 'Edit', 'Owner']">
</mj-resource-permissions>

Viewing Available Resources

<mj-available-resources
  [User]="currentUser"
  [ResourceTypeID]="dashboardResourceTypeID"
  [ResourceExtraFilter]="'IsActive = 1'"
  [SelectionMode]="'Multiple'"
  (SelectionChanged)="onResourceSelectionChanged($event)">
</mj-available-resources>

Requesting Access

<mj-request-resource-access
  [ResourceType]="'Report'"
  [ResourceName]="'Sales Dashboard'"
  [ResourceRecordID]="reportID"
  [PermissionLevel]="'View'"
  (AccessRequested)="onAccessRequested($event)">
</mj-request-resource-access>

Components

| Component | Selector | Purpose | |-----------|----------|---------| | ResourcePermissionsComponent | mj-resource-permissions | Manage user/role permissions for a resource | | AvailableResourcesComponent | mj-available-resources | Display resources available to a user | | RequestResourceAccessComponent | mj-request-resource-access | Request access to a restricted resource |

ResourcePermissionsComponent

Inputs

| Property | Type | Default | Description | |----------|------|---------|-------------| | ResourceTypeID | string | -- | ID of the resource type (required) | | ResourceRecordID | string | -- | ID of the resource record (required) | | ShowSaveButton | boolean | false | Show built-in Save button | | ShowPermissionLevels | boolean | true | Show permission level options | | AllowAddPermissions | boolean | true | Allow adding permissions | | AllowEditPermissions | boolean | true | Allow editing permissions | | AllowDeletePermissions | boolean | true | Allow deleting permissions | | PermissionLevels | string[] | ['View', 'Edit', 'Owner'] | Available permission levels | | PermissionTypes | string[] | ['User', 'Role'] | Available permission types |

Methods

| Method | Returns | Description | |--------|---------|-------------| | SavePermissions() | Promise<boolean> | Save all pending permission changes | | UpdateResourceRecordID(id) | void | Change the resource record ID |

Permission Workflow

  1. Grant access: Add a user or role permission with a specific level (View, Edit, Owner)
  2. Edit access: Change an existing permission level
  3. Revoke access: Remove a permission entry
  4. Request access: Users without permission can submit a request (created with Status = 'Requested')
  5. Approve/deny: Resource owner reviews and approves or denies the request

Dependencies