Skip to content

Conversation

@EngincanV
Copy link
Member

@EngincanV EngincanV commented Jan 19, 2026

Description

Resolves #24297

  • Changed authorization.md to authorization/index.md (the URLs are not broken) - @hikalkan I can revert that if you want-
  • In the Authorization document, I added a note to indicate it's explained for standard/global permission system and added reference for Resource Based Authorization document
  • Created the authorization/resource-based-authorization.md and explained the feature
  • Updated the permission-management.md, authorization/index.md and entities.md documents and mentioned the new feature.

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

Replaces all references to 'authorization.md' with 'authorization/index.md' across documentation files to reflect the new file structure. This ensures all internal links to the authorization documentation remain valid after the file was moved and renamed.
@EngincanV EngincanV added this to the 10.1-final milestone Jan 19, 2026
@EngincanV EngincanV requested review from Copilot and hikalkan January 19, 2026 14:23
@EngincanV EngincanV changed the title Engincan v/resource based Documentation for Resource Based Authorization Jan 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation for the resource-based authorization feature in ABP Framework, addressing issue #24297. The changes restructure the authorization documentation and add detailed guides for implementing fine-grained, per-resource access control.

Changes:

  • Adds new resource-based authorization documentation explaining how to define, check, and manage permissions for specific resource instances
  • Restructures authorization documentation from a single file to a folder structure (authorization.md → authorization/index.md)
  • Updates the Permission Management Module documentation to cover resource permission management UI components and services
  • Updates ~30 documentation files across the repository to fix broken links following the authorization documentation restructuring
  • Adds IKeyedObject interface documentation to the entities guide, explaining its role in resource-based authorization

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/en/framework/fundamentals/authorization/resource-based-authorization.md New comprehensive guide for resource-based authorization including definitions, usage examples, and integration with Permission Management Module
docs/en/framework/fundamentals/authorization/index.md Updated main authorization document with references to resource-based authorization and restructured relative paths
docs/en/framework/architecture/domain-driven-design/entities.md Added IKeyedObject interface documentation explaining its usage in resource authorization scenarios
docs/en/modules/permission-management.md Extended with resource permission management sections including UI integration examples for MVC/Blazor/Angular, IResourcePermissionManager service, and cleanup guidelines
docs/en/docs-nav.json Updated navigation structure to include resource-based authorization as a sub-item under authorization
docs/en/framework/ui/angular/account-module.md Updated authorization link (contains incorrect path)
docs/en/framework/ui/blazor/navigation-menu.md Updated authorization link (contains incorrect path)
docs/en/ui-themes/lepton-x-lite/angular.md Updated authorization link to new structure
docs/en/tutorials/book-store/part-08.md Updated authorization link to new structure
docs/en/tutorials/book-store/part-05.md Updated authorization link to new structure
docs/en/solution-templates/single-layer-web-application/solution-structure.md Updated authorization link to new structure
docs/en/solution-templates/single-layer-web-application/overview.md Updated authorization link to new structure
docs/en/solution-templates/microservice/permission-management.md Updated authorization link to new structure
docs/en/solution-templates/microservice/overview.md Updated authorization link to new structure
docs/en/solution-templates/layered-web-application/overview.md Updated authorization link to new structure
docs/en/modules/openiddict.md Updated authorization link to new structure
docs/en/modules/openiddict-pro.md Updated authorization link to new structure
docs/en/modules/identity.md Updated authorization link to new structure
docs/en/modules/identity-pro.md Updated authorization link to new structure
docs/en/index.md Updated authorization link to new structure
docs/en/framework/ui/mvc-razor-pages/* (6 files) Updated authorization links to new structure
docs/en/framework/ui/blazor/* (3 files) Updated authorization links to new structure
docs/en/framework/ui/angular/* (2 files) Updated authorization links to new structure
docs/en/framework/infrastructure/* (2 files) Updated authorization links to new structure
docs/en/framework/fundamentals/* (3 files) Updated authorization links and added resource-based authorization references
docs/en/framework/architecture/* (2 files) Updated authorization links to new structure
docs/en/framework/api-development/standard-apis/configuration.md Updated authorization link to new structure
docs/en/deployment/configuring-production.md Updated authorization link to new structure

@EngincanV EngincanV requested review from maliming and removed request for hikalkan January 26, 2026 12:17
@maliming maliming merged commit e30f335 into rel-10.1 Jan 26, 2026
8 checks passed
@maliming maliming deleted the EngincanV/resource-based branch January 26, 2026 13:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 37 changed files in this pull request and generated 4 comments.

Comment on lines +237 to +258
````csharp
public async Task DeleteDocumentAsync(Guid id)
{
// Delete the document
await _documentRepository.DeleteAsync(id);

// Clean up all permissions for this resource
await _resourcePermissionManager.DeleteAsync(
resourceName: "MyApp.Document",
resourceKey: id.ToString(),
providerName: "U",
providerKey: null // Deletes for all users
);

await _resourcePermissionManager.DeleteAsync(
resourceName: "MyApp.Document",
resourceKey: id.ToString(),
providerName: "R",
providerKey: null // Deletes for all roles
);
}
````
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup example shows calling DeleteAsync twice with different provider names. Consider mentioning that there may also be Client provider permissions that need cleanup, or clarify that this example only shows User and Role cleanup for simplicity. Additionally, consider noting that calling DeleteAsync with providerKey null will delete all permissions for that provider and resource, which could be done in a loop if there are multiple providers to clean up.

Copilot uses AI. Check for mistakes.
Implementing resource-based authorization involves three main steps:

1. **Define** resource permissions in your `PermissionDefinitionProvider`
2. **Check** permissions using `IResourcePermissionChecker`
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step 2 description mentions using IResourcePermissionChecker, but the subsequent code examples primarily demonstrate using IAuthorizationService. While both approaches are valid, this creates a potential inconsistency. Consider updating step 2 to mention both IAuthorizationService (for simpler use cases) and IResourcePermissionChecker (for advanced scenarios), or clarify that IAuthorizationService is the recommended approach with IResourcePermissionChecker available for advanced use cases.

Suggested change
2. **Check** permissions using `IResourcePermissionChecker`
2. **Check** permissions using `IAuthorizationService` (recommended for most scenarios) or `IResourcePermissionChecker` for advanced use cases

Copilot uses AI. Check for mistakes.
var book = await _bookRepository.GetAsync(id);

// Check if the current user can view this specific book
var isGranted = await AuthorizationService.IsGrantedAsync(book, BookStorePermissions.Books.Resources.View); // AuthorizationService is a property of the ApplicationService class and will be automatically injected.
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on line 151 is quite long and appears directly after the code. Consider moving this explanatory comment to a separate line before the method call, or converting it to a block comment above the line for better readability.

Copilot uses AI. Check for mistakes.
var book = await _bookRepository.GetAsync(id);

// Check if the current user can edit this specific book
var isGranted = await AuthorizationService.IsGrantedAsync(book, BookStorePermissions.Books.Resources.Edit); // AuthorizationService is a property of the ApplicationService class and will be automatically injected.
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to line 151, this inline comment is quite long. Consider moving it to a separate line or block comment above for better code readability.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants