Browse Source

Remove authorization attributes to see the blog read only.

pull/441/head
Halil ibrahim Kalkan 8 years ago
parent
commit
9f3f6de082
  1. 6
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs
  2. 11
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Tagging/TagAppService.cs
  3. 11
      modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs

6
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs

@ -12,7 +12,11 @@ using Volo.Blogging.Tagging.Dtos;
namespace Volo.Blogging.Posts
{
[Authorize(BloggingPermissions.Posts.Default)]
/* TODO: Custom policy with configuration.
* We should create a custom policy to see the blog as read only if the blog is
* configured as 'public' or the current user has the related permission.
*/
//[Authorize(BloggingPermissions.Posts.Default)]
public class PostAppService : ApplicationService, IPostAppService
{
private readonly IPostRepository _postRepository;

11
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Tagging/TagAppService.cs

@ -4,21 +4,22 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Services;
using Volo.Blogging.Posts;
using Volo.Blogging.Tagging.Dtos;
namespace Volo.Blogging.Tagging
{
[Authorize(BloggingPermissions.Tags.Default)]
/* TODO: Custom policy with configuration.
* We should create a custom policy to see the blog as read only if the blog is
* configured as 'public' or the current user has the related permission.
*/
//[Authorize(BloggingPermissions.Tags.Default)]
public class TagAppService : ApplicationService, ITagAppService
{
private readonly ITagRepository _tagRepository;
private readonly IPostTagRepository _postTagRepository;
public TagAppService(ITagRepository tagRepository, IPostTagRepository postTagRepository)
public TagAppService(ITagRepository tagRepository)
{
_tagRepository = tagRepository;
_postTagRepository = postTagRepository;
}
public async Task<List<TagDto>> GetListAsync()

11
modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs

@ -30,18 +30,17 @@ namespace Volo.Blogging
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.Configure<NavigationOptions>(options =>
Configure<NavigationOptions>(options =>
{
options.MenuContributors.Add(new BloggingMenuContributor());
});
context.Services.Configure<VirtualFileSystemOptions>(options =>
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<BloggingWebModule>("Volo.Blogging");
});
context.Services.Configure<AbpLocalizationOptions>(options =>
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<BloggingResource>()
@ -50,12 +49,12 @@ namespace Volo.Blogging
.AddVirtualJson("/Localization/Resources/Blogging/Web");
});
context.Services.Configure<AbpAutoMapperOptions>(options =>
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpBloggingWebAutoMapperProfile>(validate: true);
});
context.Services.Configure<RazorPagesOptions>(options =>
Configure<RazorPagesOptions>(options =>
{
//TODO: Make configurable!
options.Conventions.AddPageRoute("/Blog/Posts/Index", "blog/{blogShortName}");

Loading…
Cancel
Save