|
|
@@ -1,15 +1,19 @@
|
|
|
package casbin
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/auditsetting"
|
|
|
+ "dashoo.cn/backend/api/business/organize"
|
|
|
+ . "dashoo.cn/backend/api/controllers"
|
|
|
"dashoo.cn/business2/permission"
|
|
|
"dashoo.cn/utils"
|
|
|
"encoding/json"
|
|
|
- . "dashoo.cn/backend/api/controllers"
|
|
|
+ "strconv"
|
|
|
)
|
|
|
|
|
|
type PermissionController struct {
|
|
|
BaseController
|
|
|
}
|
|
|
+
|
|
|
// @Title 权限列表
|
|
|
// @Description 获取权限列表
|
|
|
// @Success 200 {object} controllers.Request
|
|
|
@@ -27,7 +31,7 @@ func (this *PermissionController) PermissionList() {
|
|
|
if parentid != "" {
|
|
|
where = where + " and Parentid like '%" + parentid + "%'"
|
|
|
}
|
|
|
- total :=svc.GetPagingEntitiesWithOrder(page.CurrentPage, page.Size, "SortCode", true, &permissionlist, where)
|
|
|
+ total := svc.GetPagingEntitiesWithOrder(page.CurrentPage, page.Size, "SortCode", true, &permissionlist, where)
|
|
|
var datainfo DataInfo
|
|
|
datainfo.Items = &permissionlist
|
|
|
datainfo.CurrentItemCount = total
|
|
|
@@ -106,7 +110,7 @@ func (this *PermissionController) EditPermission() {
|
|
|
entity.Description = model.Description
|
|
|
entity.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
|
|
|
entity.Modifiedby = this.User.Realname
|
|
|
- var cols []string = []string{"Fullname", "Parentid", "Code","Description", "Modifieduserid", "Modifiedby"}
|
|
|
+ var cols []string = []string{"Fullname", "Parentid", "Code", "Description", "Modifieduserid", "Modifiedby"}
|
|
|
err := svc.UpdateEntityAndBackupByCols(id, &entity, &entityempty, cols, utils.ToStr(this.User.Id), this.User.Realname)
|
|
|
|
|
|
if err == nil {
|
|
|
@@ -227,5 +231,19 @@ func (this *PermissionController) IsAuthorizeds() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+// @Title 当前登录人是否在企管法规处权限组中
|
|
|
+// @Description get user by token
|
|
|
+// @Param uid path string true "The key for staticblock"
|
|
|
+// @Success 200 {object} models.User
|
|
|
+// @Failure 403 :uid is empty
|
|
|
+// @router /delete-perm [get]
|
|
|
+func (this *PermissionController) GetDelAuditForProf() {
|
|
|
+ var setting auditsetting.Base_OilAuditSetting
|
|
|
+ orgSvc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ whereAudit := "AuditStepCode='PROF_REGULATION'"
|
|
|
+ orgSvc.GetEntity(&setting, whereAudit)
|
|
|
+ res := orgSvc.UserInRoleById(this.User.Id, strconv.Itoa(setting.RoleId))
|
|
|
+
|
|
|
+ this.Data["json"] = res
|
|
|
+ this.ServeJSON()
|
|
|
+}
|