File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -81,20 +81,20 @@ protected function customPermissions(): Permissions
8181
8282 if (is_array ($ customPermissions ) && !empty ($ customPermissions )) {
8383 foreach ($ customPermissions as $ key => $ permission ) {
84- // when the permission only contains permission name
85- if ( array_key_exists ( 0 , $ permission) && is_array ( $ permission)) {
86- foreach ( $ permission as $ item ) {
84+ foreach ( $ permission as $ item ) {
85+ // when the permission only contains permission name
86+ if (! is_array ( $ item) ) {
8787 $ this ->permissions [$ key ][] = [
8888 'name ' => $ item ,
8989 'title ' => ucwords (str_replace ($ this ->splitter , ' ' , $ item )),
9090 ];
91+
92+ continue ;
9193 }
9294
93- continue ;
95+ // when permission has valid permission structure (ex: slug, name key available)
96+ $ this ->permissions [$ key ][] = $ item ;
9497 }
95-
96- // when permission has valid permission structure (ex: slug, name key available)
97- $ this ->permissions [$ key ][] = $ permission ;
9898 }
9999 }
100100
You can’t perform that action at this time.
0 commit comments