using Abp.AutoMapper;
using MineTec.ProManager.Roles.Dto;
using MineTec.ProManager.Web.Models.Common;

namespace MineTec.ProManager.Web.Models.Roles
{
    [AutoMapFrom(typeof(GetRoleForEditOutput))]
    public class EditRoleModalViewModel : GetRoleForEditOutput, IPermissionsEditViewModel
    {
        public bool HasPermission(FlatPermissionDto permission)
        {
            return GrantedPermissionNames.Contains(permission.Name);
        }
    }
}
