mirror of https://github.com/abpframework/abp.git
5 changed files with 54 additions and 3 deletions
@ -0,0 +1,11 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.Abp.Authorization.TestServices |
||||
|
{ |
||||
|
public interface IMySimpleAuthorizedService |
||||
|
{ |
||||
|
Task<int> ProtectedByClassAsync(); |
||||
|
|
||||
|
Task<int> AnonymousAsync(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.Abp.Authorization.TestServices |
||||
|
{ |
||||
|
[Authorize] |
||||
|
public class MySimpleAuthorizedService : IMySimpleAuthorizedService, ITransientDependency |
||||
|
{ |
||||
|
public Task<int> ProtectedByClassAsync() |
||||
|
{ |
||||
|
return Task.FromResult(42); |
||||
|
} |
||||
|
|
||||
|
[AllowAnonymous] |
||||
|
public Task<int> AnonymousAsync() |
||||
|
{ |
||||
|
return Task.FromResult(42); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue