@memberjunction/ng-resource-permissions 2.43.0 → 2.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +81 -2
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -9,10 +9,12 @@ A suite of Angular components for managing and displaying permissions for resour
9
9
  - **Access Requests**: Allow users to request access to resources they don't have permission for
10
10
  - **Multiple Permission Types**: Support for both user and role-based permissions
11
11
  - **Configurable Permission Levels**: Customizable permission levels (View, Edit, Owner)
12
- - **Transaction Support**: Changes are grouped in transactions for data integrity
12
+ - **Transaction Support**: All permission changes are grouped in transactions for data integrity
13
+ - **Batch Operations**: Multiple permission changes can be saved together in a single transaction
13
14
  - **Filtering Options**: Filter available resources with custom criteria
14
15
  - **Resource Type Support**: Works with all MemberJunction resource types
15
16
  - **Responsive Design**: Adapts to different screen sizes and layouts
17
+ - **Error Handling**: Comprehensive error handling with optional user notifications
16
18
 
17
19
  ## Installation
18
20
 
@@ -269,6 +271,15 @@ Component for requesting access to a resource.
269
271
  2. **Viewing Available Resources**: Use the AvailableResourcesComponent to display resources a user has access to
270
272
  3. **Requesting Access**: Use the RequestResourceAccessComponent to allow users to request access to resources they don't have permission for
271
273
 
274
+ ### Permission Status
275
+
276
+ When using the RequestResourceAccessComponent, permissions are created with a status of 'Requested'. This allows resource owners to review and approve/deny access requests. The typical workflow is:
277
+
278
+ 1. User requests access to a resource → Permission created with Status = 'Requested'
279
+ 2. Resource owner reviews the request in ResourcePermissionsComponent
280
+ 3. Resource owner can approve (change status) or deny (delete) the permission
281
+ 4. Once approved, the user gains access to the resource at the specified permission level
282
+
272
283
  ## Resource Types
273
284
 
274
285
  The resource permissions system works with any resource type defined in MemberJunction, including:
@@ -290,6 +301,74 @@ The components include basic CSS that can be customized to match your applicatio
290
301
  - `@memberjunction/global`: For global utilities
291
302
  - `@memberjunction/ng-base-types`: For Angular component base classes
292
303
  - `@memberjunction/ng-notifications`: For notification services
304
+ - `@memberjunction/ng-container-directives`: For container directive utilities
305
+ - `@memberjunction/ng-generic-dialog`: For dialog components
306
+ - `@memberjunction/ng-compare-records`: For record comparison functionality
293
307
  - `@progress/kendo-angular-grid`: For grid components
294
308
  - `@progress/kendo-angular-buttons`: For UI buttons
295
- - `@progress/kendo-angular-dropdowns`: For dropdown selectors
309
+ - `@progress/kendo-angular-dropdowns`: For dropdown selectors
310
+ - `@progress/kendo-angular-dialog`: For dialog windows
311
+ - `@progress/kendo-angular-indicators`: For loading indicators
312
+ - `@progress/kendo-angular-listview`: For list view components
313
+ - `@progress/kendo-angular-layout`: For layout components
314
+
315
+ ## Building
316
+
317
+ This package is part of the MemberJunction monorepo. To build:
318
+
319
+ ```bash
320
+ # From the package directory
321
+ npm run build
322
+
323
+ # Or from the monorepo root
324
+ turbo build --filter="@memberjunction/ng-resource-permissions"
325
+ ```
326
+
327
+ ## Integration with MemberJunction
328
+
329
+ This package integrates seamlessly with the MemberJunction ecosystem:
330
+
331
+ - **ResourcePermissionEngine**: Leverages the core ResourcePermissionEngine for permission logic
332
+ - **Entity Framework**: Uses MemberJunction's entity system for data access
333
+ - **Metadata System**: Utilizes the metadata provider for entity discovery
334
+ - **Transaction Support**: Integrates with MemberJunction's transaction management
335
+ - **Notification System**: Sends notifications when access is requested
336
+
337
+ ## Advanced Usage
338
+
339
+ ### Custom Permission Validation
340
+
341
+ You can extend the permission validation logic by implementing custom checks in your application before calling the save methods on the components.
342
+
343
+ ### Programmatic Permission Management
344
+
345
+ ```typescript
346
+ import { ResourcePermissionEngine } from '@memberjunction/core-entities';
347
+ import { Metadata } from '@memberjunction/core';
348
+
349
+ // Get the engine instance
350
+ const engine = ResourcePermissionEngine.Instance;
351
+ await engine.Config();
352
+
353
+ // Check if a user has access to a resource
354
+ const hasAccess = engine.UserHasPermission(
355
+ userID,
356
+ resourceTypeID,
357
+ resourceRecordID,
358
+ 'View' // minimum permission level
359
+ );
360
+
361
+ // Get all permissions for a resource
362
+ const permissions = await engine.GetResourcePermissions(
363
+ resourceTypeID,
364
+ resourceRecordID
365
+ );
366
+ ```
367
+
368
+ ## Version
369
+
370
+ Current version: 2.43.0
371
+
372
+ ## License
373
+
374
+ ISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-resource-permissions",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "description": "MemberJunction: Generic Angular components for displaying/editing permissions for a resource",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -25,13 +25,13 @@
25
25
  "@angular/router": "18.0.2"
26
26
  },
27
27
  "dependencies": {
28
- "@memberjunction/global": "2.43.0",
29
- "@memberjunction/core": "2.43.0",
30
- "@memberjunction/core-entities": "2.43.0",
31
- "@memberjunction/ng-container-directives": "2.43.0",
32
- "@memberjunction/ng-notifications": "2.43.0",
33
- "@memberjunction/ng-generic-dialog": "2.43.0",
34
- "@memberjunction/ng-base-types": "2.43.0",
28
+ "@memberjunction/global": "2.44.0",
29
+ "@memberjunction/core": "2.44.0",
30
+ "@memberjunction/core-entities": "2.44.0",
31
+ "@memberjunction/ng-container-directives": "2.44.0",
32
+ "@memberjunction/ng-notifications": "2.44.0",
33
+ "@memberjunction/ng-generic-dialog": "2.44.0",
34
+ "@memberjunction/ng-base-types": "2.44.0",
35
35
  "@progress/kendo-angular-dropdowns": "16.2.0",
36
36
  "@progress/kendo-angular-grid": "16.2.0",
37
37
  "@progress/kendo-angular-buttons": "16.2.0",