IPermissionManager.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections.Generic;
  2. using Abp.MultiTenancy;
  3. namespace Abp.Authorization
  4. {
  5. /// <summary>
  6. /// Permission manager.
  7. /// </summary>
  8. public interface IPermissionManager
  9. {
  10. /// <summary>
  11. /// Gets <see cref="Permission"/> object with given <paramref name="name"/> or throws exception
  12. /// if there is no permission with given <paramref name="name"/>.
  13. /// </summary>
  14. /// <param name="name">Unique name of the permission</param>
  15. Permission GetPermission(string name);
  16. /// <summary>
  17. /// Gets <see cref="Permission"/> object with given <paramref name="name"/> or returns null
  18. /// if there is no permission with given <paramref name="name"/>.
  19. /// </summary>
  20. /// <param name="name">Unique name of the permission</param>
  21. Permission GetPermissionOrNull(string name);
  22. /// <summary>
  23. /// Gets all permissions.
  24. /// </summary>
  25. /// <param name="tenancyFilter">Can be passed false to disable tenancy filter.</param>
  26. IReadOnlyList<Permission> GetAllPermissions(bool tenancyFilter = true);
  27. /// <summary>
  28. /// Gets all permissions.
  29. /// </summary>
  30. /// <param name="multiTenancySides">Multi-tenancy side to filter</param>
  31. IReadOnlyList<Permission> GetAllPermissions(MultiTenancySides multiTenancySides);
  32. }
  33. }