using HospitalManagementSystem.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;

namespace HospitalManagementSystem.Permissions;

public class HospitalManagementSystemPermissionDefinitionProvider : PermissionDefinitionProvider
{
    public override void Define(IPermissionDefinitionContext context)
    {
        var HostipalManagementGroup = context.AddGroup(HospitalManagementSystemPermissions.GroupName);

        var PatientPermission = HostipalManagementGroup.AddPermission(HospitalManagementSystemPermissions.Patient.Default);
        PatientPermission.AddChild(HospitalManagementSystemPermissions.Patient.Create);
        PatientPermission.AddChild(HospitalManagementSystemPermissions.Patient.Edit);
        PatientPermission.AddChild(HospitalManagementSystemPermissions.Patient.Delete);
        //Define your own permissions here. Example:
        //myGroup.AddPermission(HospitalManagementSystemPermissions.MyPermission1, L("Permission:MyPermission1"));
    }

    private static LocalizableString L(string name)
    {
        return LocalizableString.Create<HospitalManagementSystemResource>(name);
    }
}
