Skip to content

Commit

Permalink
部分权限验证
Browse files Browse the repository at this point in the history
  • Loading branch information
liukuo362573 committed Jan 25, 2022
1 parent ce06cf8 commit 05f6152
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 0 deletions.
Expand Up @@ -49,6 +49,7 @@ public async Task<IActionResult> GetDepartmentTreeListJson(DepartmentListParam p
}

[HttpGet]
[AuthorizeFilter("organization:department:view")]
public async Task<IActionResult> GetUserTreeListJson(DepartmentListParam param)
{
TData<List<ZtreeInfo>> obj = await departmentBLL.GetZtreeUserList(param);
Expand Down
Expand Up @@ -137,20 +137,23 @@ public async Task<IActionResult> ResetPasswordJson(UserEntity entity)
}

[HttpPost]
[AuthorizeFilter("organization:user:edit")]

This comment has been minimized.

Copy link
@veigarwang

veigarwang Mar 3, 2022

是不是[AuthorizeFilter]就可以了,用户自己修改密码会用到"organization:user:edit"这么大的权限吗?

public async Task<IActionResult> ChangePasswordJson(ChangePasswordParam entity)
{
TData<long> obj = await userBLL.ChangePassword(entity);
return Json(obj);
}

[HttpPost]
[AuthorizeFilter("organization:user:edit")]

This comment has been minimized.

Copy link
@veigarwang

veigarwang Mar 3, 2022

用户自己修改也需要权限的吗?

public async Task<IActionResult> ChangeUserJson(UserEntity entity)
{
TData<long> obj = await userBLL.ChangeUser(entity);
return Json(obj);
}

[HttpPost]
[AuthorizeFilter("organization:user:edit")]
public async Task<IActionResult> ImportUserJson(ImportParam param)
{
List<UserEntity> list = new ExcelHelper<UserEntity>().ImportFromExcel(param.FilePath);
Expand All @@ -159,6 +162,7 @@ public async Task<IActionResult> ImportUserJson(ImportParam param)
}

[HttpPost]
[AuthorizeFilter("organization:user:edit")]
public async Task<IActionResult> ExportUserJson(UserListParam param)
{
TData<string> obj = new TData<string>();
Expand Down
Expand Up @@ -52,13 +52,15 @@ public async Task<IActionResult> GetPageListJson(AreaListParam param, Pagination
}

[HttpGet]
[AuthorizeFilter("system:area:view")]
public async Task<IActionResult> GetZtreeAreaListJson(AreaListParam param)
{
TData<List<ZtreeInfo>> obj = await areaBLL.GetZtreeAreaList(param);
return Json(obj);
}

[HttpGet]
[AuthorizeFilter("system:area:view")]
public async Task<IActionResult> GetFormJson(long id)
{
TData<AreaEntity> obj = await areaBLL.GetEntity(id);
Expand Down
Expand Up @@ -34,20 +34,23 @@ public IActionResult AutoJobLogForm()

#region 获取数据
[HttpGet]
[AuthorizeFilter("system:autojob:logview")]
public async Task<IActionResult> GetListJson(AutoJobLogListParam param)
{
TData<List<AutoJobLogEntity>> obj = await autoJobLogBLL.GetList(param);
return Json(obj);
}

[HttpGet]
[AuthorizeFilter("system:autojob:logview")]
public async Task<IActionResult> GetPageListJson(AutoJobLogListParam param, Pagination pagination)
{
TData<List<AutoJobLogEntity>> obj = await autoJobLogBLL.GetPageList(param, pagination);
return Json(obj);
}

[HttpGet]
[AuthorizeFilter("system:autojob:logview")]
public async Task<IActionResult> GetFormJson(long id)
{
TData<AutoJobLogEntity> obj = await autoJobLogBLL.GetEntity(id);
Expand All @@ -57,13 +60,15 @@ public async Task<IActionResult> GetFormJson(long id)

#region 提交数据
[HttpPost]
[AuthorizeFilter("system:autojob:logview")]
public async Task<IActionResult> SaveFormJson(AutoJobLogEntity entity)
{
TData<string> obj = await autoJobLogBLL.SaveForm(entity);
return Json(obj);
}

[HttpPost]
[AuthorizeFilter("system:autojob:logview")]
public async Task<IActionResult> DeleteFormJson(string ids)
{
TData obj = await autoJobLogBLL.DeleteForm(ids);
Expand Down
Expand Up @@ -52,6 +52,7 @@ public async Task<IActionResult> GetPageListJson(DataDictListParam param, Pagina
}

[HttpGet]
[AuthorizeFilter("system:datadict:view")]
public async Task<IActionResult> GetFormJson(long id)
{
TData<DataDictEntity> obj = await dataDictBLL.GetEntity(id);
Expand All @@ -66,6 +67,7 @@ public async Task<IActionResult> GetMaxSortJson()
}

[HttpGet]
[AuthorizeFilter("system:datadict:view")]
public async Task<IActionResult> GetDataDictListJson()
{
TData<List<DataDictInfo>> obj = await dataDictBLL.GetDataDictList();
Expand Down
Expand Up @@ -50,6 +50,7 @@ public async Task<IActionResult> GetPageListJson(DataDictDetailListParam param,
}

[HttpGet]
[AuthorizeFilter("system:datadict:view")]
public async Task<IActionResult> GetFormJson(long id)
{
TData<DataDictDetailEntity> obj = await dataDictDetailBLL.GetEntity(id);
Expand Down
Expand Up @@ -51,6 +51,7 @@ public async Task<IActionResult> GetTablePageListJson(string tableName, Paginati
}

[HttpGet]
[AuthorizeFilter("system:datatable:view")]
public async Task<IActionResult> GetTableFieldListJson(string tableName)
{
TData<List<TableFieldInfo>> obj = await databaseTableBLL.GetTableFieldList(tableName);
Expand Down
Expand Up @@ -43,6 +43,7 @@ public async Task<IActionResult> GetPageListJson(LogLoginListParam param, Pagina
}

[HttpGet]
[AuthorizeFilter("system:loglogin:view")]
public async Task<IActionResult> GetFormJson(long id)
{
TData<LogLoginEntity> obj = await logLoginBLL.GetEntity(id);
Expand Down
Expand Up @@ -25,6 +25,7 @@ public IActionResult LogOperateIndex()
return View();
}

[AuthorizeFilter("system:logoperate:view")]
public IActionResult LogOperateDetail()
{
return View();
Expand Down
Expand Up @@ -22,6 +22,7 @@ public IActionResult RoleIndex()
return View();
}

[AuthorizeFilter("system:role:view")]
public IActionResult RoleForm()
{
return View();
Expand Down Expand Up @@ -54,6 +55,7 @@ public async Task<IActionResult> GetFormJson(long id)
}

[HttpGet]
[AuthorizeFilter("system:role:view")]
public async Task<IActionResult> GetRoleName(RoleListParam param)
{
TData<string> obj = new TData<string>();
Expand Down

0 comments on commit 05f6152

Please sign in to comment.