You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml.cs

27 lines
690 B

using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs
{
public class IndexModel : BloggingAdminPageModel
{
private readonly IAuthorizationService _authorization;
public IndexModel(IAuthorizationService authorization)
{
_authorization = authorization;
}
public virtual async Task<ActionResult> OnGetAsync()
{
if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Management))
{
return Redirect("/");
}
return Page();
}
}
}