IPermissionChecker.cs 751 B

1234567891011121314151617181920212223
  1. using System.Threading.Tasks;
  2. namespace Abp.Authorization
  3. {
  4. /// <summary>
  5. /// This class is used to permissions for users.
  6. /// </summary>
  7. public interface IPermissionChecker
  8. {
  9. /// <summary>
  10. /// Checks if current user is granted for a permission.
  11. /// </summary>
  12. /// <param name="permissionName">Name of the permission</param>
  13. Task<bool> IsGrantedAsync(string permissionName);
  14. /// <summary>
  15. /// Checks if a user is granted for a permission.
  16. /// </summary>
  17. /// <param name="user">User to check</param>
  18. /// <param name="permissionName">Name of the permission</param>
  19. Task<bool> IsGrantedAsync(UserIdentifier user, string permissionName);
  20. }
  21. }