mirror of https://github.com/abpframework/abp
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.
27 lines
690 B
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();
|
|
}
|
|
}
|
|
}
|