This repository was archived by the owner on Sep 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-45
lines changed
Expand file tree Collapse file tree 2 files changed +6
-45
lines changed Original file line number Diff line number Diff line change 11CHANGELOG
22=====================
33
4+ v1.1
5+ ---------------------
6+ * Role permission selector now have better UI with real trees.
7+ * Bugfix: Item name validation not allow '* '.
8+
49v1.0.1
510---------------------
611* Disable inherit permissions in role permissions selector.
Original file line number Diff line number Diff line change @@ -63,51 +63,7 @@ public function attributeLabels()
6363 */
6464public static function getNamePattern ()
6565{
66- return '/^[a-z0-9\s\_\-\/]+$/i ' ;
66+ return '/^[a-z0-9\s\_\-\/\* ]+$/i ' ;
6767}
6868
69- ///=======================
70- /// TODO: regactor below
71-
72- /**
73- * @param array $array_parent
74- * @param array $params
75- * @param bool $permission
76- * @return bool
77- */
78- public function addChildrenArray (array $ array_parent , array $ params , $ permission = true )
79- {
80- foreach ($ array_parent as $ name ) {
81-
82- if ($ permission ) {
83- $ item = Yii::$ app ->authManager ->getPermission ($ name );
84- }else {
85- $ item = Yii::$ app ->authManager ->getRole ($ name );
86- }
87-
88- if (isset ($ params ['child ' ])) {
89- Yii::$ app ->authManager ->addChild ($ item , $ params ['child ' ]);
90- }elseif (isset ($ params ['parent ' ])){
91- Yii::$ app ->authManager ->addChild ($ params ['parent ' ], $ item );
92- }else {
93- return false ;
94- }
95- }
96-
97- return true ;
98- }
99-
100- /**
101- * @param array $array_parent
102- * @param $child
103- * @return bool
104- */
105- public function removeChildrenArray (array $ array_parent , $ child )
106- {
107- foreach ($ array_parent as $ parent ){
108- Yii::$ app ->authManager ->removeChild ($ parent , $ child );
109- }
110-
111- return true ;
112- }
11369}
You can’t perform that action at this time.
0 commit comments