You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuGroupsController.cs 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System.ComponentModel.DataAnnotations;
  2. using Luticate2.Auth.Attributes;
  3. using Luticate2.Auth.Dbo.Groups;
  4. using Luticate2.Auth.Dbo.Permissions;
  5. using Luticate2.Auth.Interfaces.Groups;
  6. using Luticate2.Utils.Dbo.Basic;
  7. using Luticate2.Utils.Dbo.PaginatedRequest;
  8. using Microsoft.AspNetCore.Mvc;
  9. using Microsoft.Extensions.Options;
  10. namespace Luticate2.Auth.Controllers
  11. {
  12. [Route(LuAuthExtensions.RoutePrefix)]
  13. public class LuGroupsController : LuAuthCrudController<ILuGroupsBusiness, LuGroupsAddDbo, LuGroupsDbo, LuGroupsAddDbo, string>
  14. {
  15. private const string EntityType = LuEntityTypes.LuGroups;
  16. private const string ReadPermission = LuPermissions.LuGroupsRead;
  17. private const string WritePermission = LuPermissions.LuGroupsWrite;
  18. public LuGroupsController(ILuGroupsBusiness busines, IOptions<LuUtilsOptionsDbo> luUtilsOptionsDbo) : base(busines, luUtilsOptionsDbo)
  19. {
  20. }
  21. [LuPermission(ReadPermission, EntityType)]
  22. public override LuApiWrapperDbo<LuGroupsDbo> GetSingleById([LuPermissionArg][Required]string id)
  23. {
  24. return base.GetSingleById(id);
  25. }
  26. [LuPermission(ReadPermission, EntityType)]
  27. public override LuApiWrapperDbo<LuPaginatedDbo<LuGroupsDbo>> GetMultiple([Required]LuPaginatedRequestDbo request)
  28. {
  29. return base.GetMultiple(request);
  30. }
  31. [LuPermission(WritePermission, EntityType)]
  32. public override LuApiWrapperDbo<LuGroupsDbo> AddDbo([Required]LuGroupsAddDbo data)
  33. {
  34. return base.AddDbo(data);
  35. }
  36. [LuPermission(WritePermission, EntityType)]
  37. public override LuApiWrapperDbo<LuGroupsDbo> EditSingleByIdDbo([LuPermissionArg][Required]string id, [Required]LuGroupsAddDbo data)
  38. {
  39. return base.EditSingleByIdDbo(id, data);
  40. }
  41. [LuPermission(WritePermission, EntityType)]
  42. public override LuApiWrapperDbo<LuGroupsDbo> Delete([LuPermissionArg][Required]string id)
  43. {
  44. return base.Delete(id);
  45. }
  46. }
  47. }