راه حلهای مختلفی برای مدیریت دسترسیهای پویا وجود دارد که باتوجه به Domain ای که در آن قرار داریم میتوانند مورد استفاده قرار بگیرند و در این رابطه مطالب زیادی هم ارائه شده است؛ در این راستا یکی از راه حل هایی که در یکی سیستمها استفاده کرده ایم را در این gist میتوانید مشاهده کنید.
در راه حل ارائه شده، علاوه بر این که امکان اعطای یکسری دسترسی برای گروههای کاربری وجود دارد، میتوان دسترسی هایی را به صورت مستقیم برای کاربر خاصی نیز اعطاء کرد یا یکسری از دسترسیهای کاربر را که از طریق گروههای کاربری خود دارا میباشد را از او گرفت و ...
public static class PermissionNames
{
public const string Pages = nameof(Pages);
public const string Pages_Administration = nameof(Pages_Administration);
public const string Pages_Administration_Roles = nameof(Pages_Administration_Roles);
public const string Pages_Administration_Roles_Create = nameof(Pages_Administration_Roles_Create);
public const string Pages_Administration_Roles_Edit = nameof(Pages_Administration_Roles_Create);
public const string Pages_Administration_Roles_Delete = nameof(Pages_Administration_Roles_Create);
public const string Pages_Administration_Users = nameof(Pages_Administration_Users);
public const string Pages_Administration_Users_Create = nameof(Pages_Administration_Users_Create);
public const string Pages_Administration_Users_Edit = nameof(Pages_Administration_Users_Create);
public const string Pages_Administration_Users_Delete = nameof(Pages_Administration_Users_Create);
//...
}