IAuthorizationService.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using Microsoft.AspNetCore.Authorization;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Security.Principal;
  5. using System.Text;
  6. namespace GreenTree.Strohrmann.ERP.Services.Authorization
  7. {
  8. public interface IAuthorizationService
  9. {
  10. /// <summary>
  11. /// Check wether the user has a specific policy
  12. /// </summary>
  13. /// <param name="identity">The user identity.</param>
  14. /// <param name="policy">The policy to be checked.</param>
  15. public bool UserHasPolicy(IIdentity identity, string policy);
  16. /// <summary>
  17. /// Check wether the user has any policy regarding base data management
  18. /// </summary>
  19. /// <param name="identity">The user identity.</param>
  20. public bool UserHasBasedataPolicy(IIdentity identity);
  21. /// <summary>
  22. /// Check wether the user has any policy in a specific category
  23. /// </summary>
  24. /// <param name="identity">The user identity.</param>
  25. /// <param name="category">The category (e.g. 'Customer').</param>
  26. public bool UserHasCategoryPolicy(IIdentity identity, string category);
  27. }
  28. }