切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
cxb
5 years ago
提交
e216bd77510397e621c0b7340300aae5a636ba7d
1 个父辈
2b60921c
解决角色组跨权限查看编辑的问题,修正角色组移动时不能为节点的子节点
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
12 行增加
和
3 行删除
application/admin/controller/auth/Group.php
application/admin/lang/zh-cn/auth/group.php
application/admin/controller/auth/Group.php
查看文件 @
e216bd7
...
...
@@ -95,7 +95,7 @@ class Group extends Backend
$params
=
$this
->
request
->
post
(
"row/a"
,
[],
'strip_tags'
);
$params
[
'rules'
]
=
explode
(
','
,
$params
[
'rules'
]);
if
(
!
in_array
(
$params
[
'pid'
],
$this
->
childrenGroupIds
))
{
$this
->
error
(
__
(
'The parent group
can not be its own child
'
));
$this
->
error
(
__
(
'The parent group
exceeds permission limit
'
));
}
$parentmodel
=
model
(
"AuthGroup"
)
->
get
(
$params
[
'pid'
]);
if
(
!
$parentmodel
)
{
...
...
@@ -125,6 +125,9 @@ class Group extends Backend
*/
public
function
edit
(
$ids
=
null
)
{
if
(
!
in_array
(
$ids
,
$this
->
childrenGroupIds
))
{
$this
->
error
(
__
(
'You have no permission'
));
}
$row
=
$this
->
model
->
get
([
'id'
=>
$ids
]);
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
...
...
@@ -132,9 +135,13 @@ class Group extends Backend
if
(
$this
->
request
->
isPost
())
{
$this
->
token
();
$params
=
$this
->
request
->
post
(
"row/a"
,
[],
'strip_tags'
);
//
父节点不能是它自身的子
节点
//
父节点不能是非权限内
节点
if
(
!
in_array
(
$params
[
'pid'
],
$this
->
childrenGroupIds
))
{
$this
->
error
(
__
(
'The parent group can not be its own child'
));
$this
->
error
(
__
(
'The parent group exceeds permission limit'
));
}
// 父节点不能是它自身的子节点或自己本身
if
(
in_array
(
$params
[
'pid'
],
Tree
::
instance
()
->
getChildrenIds
(
$row
->
id
,
true
))){
$this
->
error
(
__
(
'The parent group can not be its own child or itself'
));
}
$params
[
'rules'
]
=
explode
(
','
,
$params
[
'rules'
]);
...
...
application/admin/lang/zh-cn/auth/group.php
查看文件 @
e216bd7
...
...
@@ -7,4 +7,6 @@ return [
'Can not change the parent to child'
=>
'父组别不能是它的子组别'
,
'Can not change the parent to self'
=>
'父组别不能是它的子组别'
,
'You can not delete group that contain child group and administrators'
=>
'你不能删除含有子组和管理员的组'
,
'The parent group exceeds permission limit'
=>
'父组别超出权限范围'
,
'The parent group can not be its own child or itself'
=>
'父组别不能是它的子组别及本身'
,
];
...
...
请
注册
或
登录
后发表评论