1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System.ComponentModel.DataAnnotations;
- using Luticate2.Auth.Attributes;
- using Luticate2.Auth.Dbo.Groups;
- using Luticate2.Auth.Dbo.Permissions;
- using Luticate2.Auth.Interfaces.Groups;
- using Luticate2.Utils.Dbo.Basic;
- using Luticate2.Utils.Dbo.PaginatedRequest;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Options;
-
- namespace Luticate2.Auth.Controllers
- {
- [Route(LuAuthExtensions.RoutePrefix)]
- public class LuGroupsController : LuAuthCrudController<ILuGroupsBusiness, LuGroupsAddDbo, LuGroupsDbo, LuGroupsAddDbo, string>
- {
- private const string EntityType = LuEntityTypes.LuGroups;
-
- private const string ReadPermission = LuPermissions.LuGroupsRead;
-
- private const string WritePermission = LuPermissions.LuGroupsWrite;
-
- public LuGroupsController(ILuGroupsBusiness busines, IOptions<LuUtilsOptionsDbo> luUtilsOptionsDbo) : base(busines, luUtilsOptionsDbo)
- {
- }
-
- [LuPermission(ReadPermission, EntityType)]
- public override LuApiWrapperDbo<LuGroupsDbo> GetSingleById([LuPermissionArg][Required]string id)
- {
- return base.GetSingleById(id);
- }
-
- [LuPermission(ReadPermission, EntityType)]
- public override LuApiWrapperDbo<LuPaginatedDbo<LuGroupsDbo>> GetMultiple([Required]LuPaginatedRequestDbo request)
- {
- return base.GetMultiple(request);
- }
-
- [LuPermission(WritePermission, EntityType)]
- public override LuApiWrapperDbo<LuGroupsDbo> AddDbo([Required]LuGroupsAddDbo data)
- {
- return base.AddDbo(data);
- }
-
- [LuPermission(WritePermission, EntityType)]
- public override LuApiWrapperDbo<LuGroupsDbo> EditSingleByIdDbo([LuPermissionArg][Required]string id, [Required]LuGroupsAddDbo data)
- {
- return base.EditSingleByIdDbo(id, data);
- }
-
- [LuPermission(WritePermission, EntityType)]
- public override LuApiWrapperDbo<LuGroupsDbo> Delete([LuPermissionArg][Required]string id)
- {
- return base.Delete(id);
- }
- }
- }
|