add support tags ...
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using xCommons.Extensions;
|
||||
using xTagService.Providers;
|
||||
using xIdentityModels.Models;
|
||||
using xContentService.Constants;
|
||||
using xContentService.Interfaces;
|
||||
using xContentService.Models.Dtos;
|
||||
using xContentService.Providers.Dtos;
|
||||
using xContentService.Interfaces.Dtos;
|
||||
using xContentService.Models.Entities;
|
||||
|
||||
namespace xContentService.Providers
|
||||
{
|
||||
public class XContentTagProvided : XBaseTagProvided<XContent, XContentDto, Guid, XContentDtoHub>, IXContentTagProvided
|
||||
{
|
||||
public XContentTagProvided(
|
||||
IXContentTagProvider tagProvider,
|
||||
IXContentServiceProvider provider
|
||||
) : base(
|
||||
provider: provider,
|
||||
tagProvider: tagProvider,
|
||||
permittedRoles: [XContentServiceConstants.XAdminRole]
|
||||
)
|
||||
{ }
|
||||
|
||||
public override bool IsOwned(
|
||||
XContent item,
|
||||
XUserClaimsInfoDto userInfo
|
||||
)
|
||||
{
|
||||
//
|
||||
var result =
|
||||
!item.IsNullOrDefault() &&
|
||||
!userInfo.IsNullOrDefault() &&
|
||||
item.OwnerId == userInfo.UserId;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public override bool IsOwned(
|
||||
XContentDto item,
|
||||
XUserClaimsInfoDto userInfo
|
||||
)
|
||||
{
|
||||
//
|
||||
var result =
|
||||
!item.IsNullOrDefault() &&
|
||||
!userInfo.IsNullOrDefault() &&
|
||||
item.OwnerId == userInfo.UserId;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user