caipin 4 năm trước cách đây
mục cha
commit
1e9ef60fc7
1 tập tin đã thay đổi với 15 bổ sung15 xóa
  1. 15 15
      web/middleware/access_backstage.go

+ 15 - 15
web/middleware/access_backstage.go

@@ -19,22 +19,22 @@ func AccessBackstageAuth(ctx iris.Context) {
 	managerData := managerDao.GetUserName(staffName)
 
 	// 2.特定路由下的访问权限
-	path := ctx.Path()
-	// 新增项目
-	if path == "/api/backstage/project/add" {
-		if managerData.IsAdmin != 1 {
-			ctx.JSON(iris.Map{"code": 2, "msg": "管理员才能新增项目"})
-			return
-		}
-	}
+	// path := ctx.Path()
+	// // 新增项目
+	// if path == "/api/backstage/project/add" {
+	// 	if managerData.IsAdmin != 1 {
+	// 		ctx.JSON(iris.Map{"code": 2, "msg": "管理员才能新增项目"})
+	// 		return
+	// 	}
+	// }
 
-	// 编辑项目-只有管理员和自己能编辑项目
-	if path == "/api/backstage/project/save" {
-		if managerData.IsAdmin != 1 {
-			ctx.JSON(iris.Map{"code": 2, "msg": "管理员才能新增项目"})
-			return
-		}
-	}
+	// // 编辑项目-只有管理员和自己能编辑项目
+	// if path == "/api/backstage/project/save" {
+	// 	if managerData.IsAdmin != 1 {
+	// 		ctx.JSON(iris.Map{"code": 2, "msg": "管理员才能新增项目"})
+	// 		return
+	// 	}
+	// }
 
 	ctx.Values().Set("manager", managerData)