- ABP Framework version: v8.0.4
- UI Type: Blazor Server
- Database System: EF Core (SQL Server) - Azure Blob Storage
- Steps to reproduce the issue:
We need to permission role based access to files and folders in the File Management module. Can you please provide any recommendations on how to accomplish?
Thanks
11 Answer(s)
-
0
Hello,
Can you please check this https://docs.abp.io/en/abp/latest/UI/Angular/Permission-Management
Thanks
-
0
How are permissions mapped to File Management files and actions?
-
0
Hello,
I have created one role as Admin and give him permissions of folder and again I have created one role Manager and give him permissions of file.
permissions of Admin role
permissions of manager role
Now I have created 2 users, user1 and user2.
user1 is assigned with role Admin and user2 is assigned with role manager. Check the permissions given to user1
permissions given to user2
Now user1 can have access to crud operations of Folders only and not of files.
and user2 can have access to crud operations of Files only and not of folders.
In this way you can implement as per your requirement.
Thanks, Anjali
-
0
Hi Anjali
I see what you're saying but we need to apply permissions on a per folder and per file basis.
-
0
Hello ,
If you have to apply permissions on a per folder and per file then you have to customize code at your own side .
Thank you.
-
0
Can you give some guidance on a good place to start interacting with the existing code?
Can we override any existing classes?
-
0
-
0
Hi
It makes sense how to add permissions but what we need help with is where do we apply the permissions on a file by file basis?
How do we mark a file as confidential for example and then based on a permission filter it out from being viewable in the directory tree?
-
0
Hello,
ABP.io's file management module offers functionalities but doesn't provide built-in features for granular permissions on individual files. ABP's existing permission management system is used to grant access to folders based on user roles. The functionality you want to develop will require custom development efforts. You may also refer this https://docs.abp.io/en/commercial/latest/tutorials/book-store/part-5?UI=BlazorServer&DB=EF#permissions
in summary it was enough to make a little bit research and we're supporting for lack of system not for specific custom logic 🙂
I hope I could answer your question.
Thanks,
-
0
We really need to understand better how to interact with the file management APIs so as to override them.
Managing permissions isn't the requirement here. We need support in applying permissions against the module.
Can we get some basic documentation and or explanation of how the module works?
The wiki is very limited on this module.
-
0
Hi,
It makes sense how to add permissions but what we need help with is where do we apply the permissions on a file by file basis?
You can override the
DirectoryDescriptorAppService
andFileDescriptorAppService
services.For example:
[ExposeServices(typeof(IDirectoryDescriptorRepository))] [Dependency(ReplaceServices = true)] public class MyDirectoryDescriptorAppService : DirectoryDescriptorAppService { public MyDirectoryDescriptorAppService(IDirectoryManager directoryManager, IFileManager fileManager, IDirectoryDescriptorRepository directoryDescriptorRepository, IFileDescriptorRepository fileDescriptorRepository, IOptions<FileIconOption> fileIconOption) : base(directoryManager, fileManager, directoryDescriptorRepository, fileDescriptorRepository, fileIconOption) { } public override async Task<ListResultDto<DirectoryDescriptorInfoDto>> GetListAsync(Guid? parentId) { var list = await base.GetListAsync(parentId); foreach (var item in list.Items) { // check permission here } } }
How do we mark a file as confidential for example and then based on a permission filter it out from being viewable in the directory tree?
You can add an entity action to the action menu for an entity to make file as confidential
https://docs.abp.io/en/abp/latest/UI/Blazor/Entity-Action-Extensions