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.
33 lines
1.1 KiB
33 lines
1.1 KiB
using Infrastructure.Application;
|
|
using Infrastructure.Data;
|
|
using Infrastructure.Extensions;
|
|
using Infrastructure.Web.Mvc;
|
|
using IoT.Shared.Application.Domain.Entities;
|
|
using IoT.Shared.Application.Models;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Platform.Areas.IoTCenter.Controllers;
|
|
using System.Linq;
|
|
|
|
namespace IoT.Shared.Areas.UserCenter.Controllers
|
|
{
|
|
[Authorize]
|
|
[ApiController]
|
|
[Route("UserCenter/[controller]/[action]")]
|
|
[Area("UserCenter")]
|
|
[ControllerScope(ControllerScopeType.Organ)]
|
|
public class OrganOrganRoleController : OrganRoleController
|
|
{
|
|
public OrganOrganRoleController(IRepository<OrganRole> repo, AjaxController ajax, IRepository<Organ> organRepo) : base(repo, ajax, organRepo)
|
|
{
|
|
}
|
|
|
|
public override IQueryable<OrganRole> Query(PagedListModel<EditRoleModel> model, IQueryable<OrganRole> query)
|
|
{
|
|
var organId = User.GetOrganId();
|
|
return base.Query(model, query)
|
|
.WhereIf(organId.HasValue, o => o.OrganId == organId.Value);
|
|
}
|
|
}
|
|
}
|