-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdmin.php
More file actions
653 lines (571 loc) · 24.3 KB
/
Admin.php
File metadata and controls
653 lines (571 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
<?php
/**
* 이 파일은 아이모듈 관리자모듈의 일부입니다. (https://www.imodules.io)
*
* 관리자 클래스를 정의한다.
* 아이모듈 관리자 페이지를 구성한다.
*
* @file /modules/admin/Admin.php
* @author sungjin <esung246@naddle.net>
* @license MIT License
* @modified 2025. 3. 19.
*/
namespace modules\admin;
class Admin extends \Module
{
/**
* @var \modules\admin\dtos\Administrator[] $_administrators 관리자 회원 정보
*/
private static array $_administrators = [];
/**
* @var \modules\admin\dtos\Context[] $_contexts 전체 컴포넌트의 관리자 컨텍스트 정보
*/
private static array $_contexts;
/**
* @var \modules\admin\dtos\Scope[] $_scopes 전체 컴포넌트의 관리자 권한범위 정보
*/
private static array $_scopes;
/**
* @var \modules\admin\dtos\Group[] $_groups 관리자그룹정보
*/
private static array $_groups = [];
/**
* 모듈 설정을 초기화한다.
*/
public function init(): void
{
/**
* 관리자 페이지를 위한 모듈 라우터를 초기화한다.
*/
\Router::add('/admin', '#', 'html', [$this, 'doRoute']);
\Router::add('/admin/*', '#', 'html', [$this, 'doRoute']);
\Router::add('/preview', '#', 'html', [$this, 'doPreview']);
\Router::add('/preview/*', '#', 'html', [$this, 'doPreview']);
}
/**
* 현재 관리자화면의 언어코드를 가져온다.
*
* @return string $langauge
*/
public function getLanguage(): string
{
return $this->getAdministrator()?->getLanguage() ?? \Request::languages(true);
}
/**
* 관리자 정보를 가져온다.
*
* @param ?int $member_id 회원고유값 (NULL 인 경우 현재 로그인한 사용자)
* @param bool $refresh 정보를 갱신할지 여부
* @return ?\modules\admin\dtos\Administrator $administrator
*/
public function getAdministrator(?int $member_id = null, bool $refresh = false): ?\modules\admin\dtos\Administrator
{
/**
* @var \modules\member\Member $mMember
*/
$mMember = \Modules::get('member');
$member = $mMember->getMember($member_id);
if ($member->isMember() === false) {
return null;
}
$member_id = $member->getId();
if ($refresh === false && isset(self::$_administrators[$member_id]) == true) {
return self::$_administrators[$member_id];
}
$administrator = $this->db()
->select()
->from($this->table('administrators'))
->where('member_id', $member_id)
->getOne();
if ($administrator === null) {
$administrator = new \stdClass();
$administrator->member_id = $member_id;
$administrator->language = null;
$administrator->navigation = null;
$administrator->permissions = false;
} else {
$administrator->navigation = json_decode($administrator->navigation ?? 'null');
$administrator->permissions = json_decode($administrator->permissions ?? 'false');
}
self::$_administrators[$member_id] = new \modules\admin\dtos\Administrator($administrator);
return self::$_administrators[$member_id];
}
/**
* 관리자 전체 컨텍스트를 가져온다.
*
* @return \modules\admin\dtos\Context[] $contexts
*/
public function getAdminContexts(): array
{
if (isset(self::$_contexts) == false) {
self::$_contexts = [];
/**
* 모듈의 관리자 컨텍스트를 가져온다.
*/
foreach (\Modules::all() as $module) {
foreach ($module->getAdmin()?->getContexts() ?? [] as $context) {
self::$_contexts[$context->getPath()] = $context;
}
}
/**
* @todo 플러그인의 관리자 컨텍스트를 가져온다.
*/
/**
* @todo 위젯의 관리자 컨텍스트를 가져온다.
*/
}
return self::$_contexts;
}
/**
* 현재 관리자 경로에 해당하는 컨텍스트를 가져온다.
*
* @param \Route $route 현재 경로
* @return ?\modules\admin\dtos\Context $context
*/
public function getAdminContext(\Route $route): ?\modules\admin\dtos\Context
{
$contexts = $this->getAdminContexts();
$navigation = $this->getAdministrator()->getNavigation();
$paths = array_keys($contexts);
$routes = explode('/', $route->getSubPath());
/**
* 관리자 루트인 경우, 관리자의 첫번째 컨텍스트를 반환한다.
*/
if (count($routes) == 1) {
foreach ($navigation as $item) {
if ($item->type == 'FOLDER') {
foreach ($item->children() as $child) {
if ($item->type != 'LINK') {
return $contexts[$child->path];
}
}
} elseif ($item->type != 'LINK') {
return $contexts[$item->path];
}
}
return $contexts['/dashboard'];
}
/**
* 전체 컨텍스트에서 경로와 일치하는 컨텍스트를 찾는다.
*/
while (count($routes) > 1) {
$path = implode('/', $routes);
if (in_array($path, $paths) == true) {
return $contexts[$path];
}
array_pop($routes);
}
return null;
}
/**
* 관리자 전체 권한범위를 가져온다.
*
* @return \modules\admin\dtos\Scope[] $scope
*/
public function getAdminScopes(): array
{
if (isset(self::$_scopes) == false) {
self::$_scopes = [];
/**
* 모듈의 관리자 권한범위를 가져온다.
*/
self::$_scopes['module'] = [];
foreach (\Modules::all() as $module) {
$scopes = [];
foreach ($module->getAdmin()?->getScopes() ?? [] as $scope) {
$scopes[$scope->getCode()] = $scope;
}
if (count($scopes) > 0) {
self::$_scopes['module'][$scope->getComponent()->getName()] = $scopes;
}
}
/**
* @todo 플러그인의 관리자 컨텍스트를 가져온다.
*/
self::$_scopes['plugin'] = [];
/**
* @todo 위젯의 관리자 컨텍스트를 가져온다.
*/
self::$_scopes['widget'] = [];
}
return self::$_scopes;
}
/**
* 관리자그룹정보를 가져온다.
*
* @param string $group_id
* @return ?\modules\admin\dtos\Group $group
*/
public function getAdminGroup(string $group_id): ?\modules\admin\dtos\Group
{
if (isset(self::$_groups[$group_id]) == true) {
return self::$_groups[$group_id];
}
self::$_groups[$group_id] = null;
if (
$group_id == 'user' ||
$group_id == 'component' ||
preg_match('/^component-(module|plugin|widget)-[^-]+$/', $group_id) == true
) {
return null;
} else {
$temp = explode('-', $group_id);
if ($temp[0] == 'component') {
if (count($temp) != 4) {
return null;
}
if ($temp[1] == 'module') {
self::$_groups[$group_id] =
\Modules::get($temp[2])
->getAdmin()
?->getGroup($temp[3]) ?? null;
}
} else {
$group = $this->db()
->select()
->from($this->table('groups'))
->where('group_id', $group_id)
->getOne();
if ($group === null) {
self::$_groups[$group_id] = null;
} else {
self::$_groups[$group_id] = new \modules\admin\dtos\Group($this->getAdmin());
self::$_groups[$group_id]
->setGroup($group->group_id, $group->title)
->setCount($group->administrators)
->setPermission(
\modules\admin\dtos\Permission::init()->setPermissions(json_decode($group->permissions))
)
->setGetter(function ($group) {
/**
* @var \modules\admin\admin\Admin $mAdmin
*/
$mAdmin = $group->getAdmin();
return $mAdmin
->db()
->select()
->from($mAdmin->table('group_administrators'))
->where('group_id', $group->getId())
->get('member_id');
});
}
}
}
return self::$_groups[$group_id];
}
/**
* 관리자페이지 라우팅을 처리한다.
*
* @param \Route $route 현재경로
*/
public function doRoute(\Route $route): string
{
\iModules::session_start();
/**
* IP제한설정을 확인한다.
*/
if ($this->getConfigs('use_whitelist') == true) {
$whitelist = explode("\n", $this->getConfigs('whitelist') ?? '');
$checked = false;
foreach ($whitelist as $ip) {
$ip = \Format::reg($ip);
$ip = str_replace('\*', '[0-9a-f]+', $ip);
if (preg_match('/' . $ip . '/', $_SERVER['REMOTE_ADDR']) == true) {
$checked = true;
}
}
if ($checked === false) {
\ErrorHandler::print(\ErrorHandler::error('NOT_FOUND_URL'));
}
}
\Events::fireEvent($this, 'beforeAdminLayout', []);
/**
* 아이모듈 관리자 테마를 설정한다.
*/
$theme = new \Theme($this->getConfigs('theme'));
/**
* 현재 접속한 유저의 정보를 가져온다.
* @var \modules\member\Member $mMember
*/
$mMember = \Modules::get('member');
$member = $mMember->getMember();
/**
* 웹폰트를 불러온다.
*/
\Html::font('XEIcon');
\Html::font('FontAwesome');
/**
* BODY 타입을 지정한다.
*/
\Html::type('admin');
\Html::body('data-role', 'module');
\Html::body('data-module', 'admin');
/**
* 관리자가 아니라면 로그인 레이아웃을 출력한다.
*/
if ($this->getAdministrator()?->isAdministrator() !== true) {
\Html::style($this->getBase() . '/ui/styles/Aui.Base.css');
\Html::style($this->getBase() . '/admin/styles/Admin.css', 15);
return $theme->getIndex($theme->getLayout('login'));
}
/**
* Aui 스타일과 충돌을 피하기 위해 기본 스타일시트를 제거한다.
*/
\Html::style('/styles/common.css', -1);
\Html::body('data-color-scheme', $this->getAdministrator()?->getColor() ?? 'auto');
\Html::body('data-scale', $this->getAdministrator()?->getScale() ?? 16);
$theme->assign('mMember', $mMember);
$theme->assign('member', $member);
$context = $this->getAdminContext($route);
if ($context === null) {
\ErrorHandler::print(\ErrorHandler::error('NOT_FOUND_URL'));
}
if (
$context->getPath() != '/' &&
preg_match('/^' . \Format::reg($context->getPath()) . '/', $route->getSubPath()) == false
) {
\Header::location($route->getUrl() . $context->getPath());
}
$this->getAdmin()->storeLog(true, true);
/**
* 기본 자바스크립트파일을 불러온다.
* 사용되는 모든 스크립트 파일을 캐시를 이용해 압축한다.
*/
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Base.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Loading.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Scroll.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Drag.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Resizer.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Data.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Component.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Absolute.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Store.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Title.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Text.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Button.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Panel.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Explorer.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Toolbar.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Tab.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Grid.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Tree.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Form.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Window.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Message.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Progress.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Viewport.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Navigation.js');
\Cache::script('Aui', $this->getBase() . '/ui/scripts/Aui.Menu.js');
\Html::script(\Cache::script('Aui'), 10);
\Cache::script('Admin.ui', $this->getBase() . '/admin/scripts/ui/Admin.js');
\Cache::script('Admin.ui', $this->getBase() . '/admin/scripts/ui/AdminUi.Form.js');
\Html::script(\Cache::script('Admin.ui'), 15);
\Cache::script('Admin.component', $this->getBase() . '/admin/scripts/Component.js');
/**
* 모든 모듈의 관리자 스크립트를 가져온다.
*/
foreach (\Modules::all(false) as $module) {
if (is_file($module->getPath() . '/admin/scripts/' . $module->getClassName() . '.js') == true) {
\Cache::script(
'Admin.component',
$module->getBase() . '/admin/scripts/' . $module->getClassName() . '.js'
);
}
$scripts = $module->getAdmin()?->getScripts() ?? [];
foreach ($scripts as $script) {
\Cache::script('Admin.component', $script);
}
}
/**
* 모든 플러그인의 관리자 스크립트를 가져온다.
*/
foreach (\Plugins::all(false) as $plugin) {
if (is_file($plugin->getPath() . '/admin/scripts/' . $plugin->getClassName() . '.js') == true) {
\Cache::script(
'Admin.component',
$plugin->getBase() . '/admin/scripts/' . $plugin->getClassName() . '.js'
);
}
$scripts = $plugin->getAdmin()?->getScripts() ?? [];
foreach ($scripts as $script) {
\Cache::script('Admin.component', $script);
}
}
\Html::script(\Cache::script('Admin.component'), 20);
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Base.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Loading.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Scroll.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Component.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Absolute.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Resizer.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Title.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Text.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Button.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Panel.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Explorer.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Toolbar.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Tab.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Grid.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Tree.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Form.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Window.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Message.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Progress.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Viewport.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Navigation.css');
\Cache::style('Aui', $this->getBase() . '/ui/styles/Aui.Menu.css');
\Html::style(\Cache::style('Aui'), 10);
\Cache::style('Admin.Component', $this->getBase() . '/admin/styles/Admin.css');
/**
* 설치된 모듈의 관리자 스타일시트를 가져온다.
*/
foreach (\Modules::all() as $module) {
if (is_file($module->getPath() . '/admin/styles/' . $module->getClassName() . '.css') == true) {
\Cache::style(
'Admin.Component',
$module->getBase() . '/admin/styles/' . $module->getClassName() . '.css'
);
}
$styles = $module->getAdmin()?->getStyles() ?? [];
foreach ($styles as $style) {
\Cache::style('Admin.Component', $style);
}
}
/**
* 설치된 플러그인의 관리자 스타일시트를 가져온다.
*/
foreach (\Plugins::all() as $plugin) {
if (is_file($plugin->getPath() . '/admin/styles/' . $plugin->getClassName() . '.css') == true) {
\Cache::style(
'Admin.Component',
$plugin->getBase() . '/admin/styles/' . $plugin->getClassName() . '.css'
);
}
$styles = $plugin->getAdmin()?->getStyles() ?? [];
foreach ($styles as $style) {
\Cache::style('Admin.Component', $style);
}
}
\Html::style(\Cache::style('Admin.Component'), 20);
/**
* @var \modules\wysiwyg\Wysiwyg $mWysiwyg 위지윅에디터를 위한 스크립트를 불러온다.
*/
$mWysiwyg = \Modules::get('wysiwyg');
$mWysiwyg->preload();
\Html::style($mWysiwyg->getBase() . '/styles/Wysiwyg.css');
$subPath = preg_replace('/^' . \Format::reg($context->getPath()) . '/', '', $route->getSubPath());
$theme->assign('content', $context->getContent($subPath ? $subPath : null));
\Html::body('data-context-url', $context->getPath());
return $theme->getIndex($theme->getLayout('admin'));
}
/**
* 관리자페이지 라우팅을 처리한다.
*
* @param \Route $route 현재경로
*/
public function doPreview(\Route $route): string
{
$subPath = explode('/', $route->getSubPath());
$type = $subPath[1];
$is_viewer = end($subPath) === 'viewer';
\Html::style($this->getBase() . '/admin/styles/preview.css');
\Html::body('data-type', 'preview');
if ($is_viewer === true) {
\Cache::use(false);
if ($type == 'page') {
\Html::body('data-preview', 'page');
$host = \Request::get('host', true);
$language = \Request::get('language', true);
$page = \Request::get('page', true);
$site = \Sites::get($host, $language);
$theme = $site->getTheme();
$theme->assign('site', $site);
$theme->assign('route', \Router::get('/'));
$theme->assign('context', \Contexts::get(\Router::get('/')));
return $theme->getLayout('NONE', $theme->getPage($page));
}
} else {
\Html::script($this->getBase() . '/admin/scripts/preview.js');
\Html::body('data-preview', 'body');
if ($type == 'page') {
$host = \Request::get('host', true);
$language = \Request::get('language', true);
$page = \Request::get('page', true);
$queryString = [
'host' => $host,
'language' => $language,
'page' => $page,
];
}
$src = $route->getSubUrl('/' . $type . '/viewer', $queryString);
$frame = \Html::element('iframe', ['src' => $src, 'frameborder' => 0], 'NOT_SUPPORTED');
return \Html::element('div', ['id' => 'preview', 'style' => 'width:1400px;'], $frame);
}
}
/**
* 특수한 에러코드의 경우 에러데이터를 현재 클래스에서 처리하여 에러클래스로 전달한다.
*
* @param string $code 에러코드
* @param ?string $message 에러메시지
* @param ?object $details 에러와 관련된 추가정보
* @return \ErrorData $error
*/
public function error(string $code, ?string $message = null, ?object $details = null): \ErrorData
{
switch ($code) {
/**
* 관리자 컨텍스트 URL 이 이미 정의된 경우
*/
case 'DUPLICATED_ADMIN_CONTEXT_PATH':
$error = \ErrorHandler::data($code);
$error->message = $this->getErrorText('DUPLICATED_ADMIN_CONTEXT_PATH', [
'path' => $message,
'name' => $details->getComponent()->getTitle($this->getLanguage()),
'component' => get_class($details->getComponent()),
]);
return $error;
/**
* 권한이 부족한 경우, 로그인이 되어 있지 않을 경우, 로그인관련 에러메시지를 표시하고
* 그렇지 않은 경우 권한이 부족하다는 에러메시지를 표시한다.
*/
case 'FORBIDDEN':
$error = \ErrorHandler::data($code);
/**
* @var \modules\member\Member $mMember
*/
$mMember = \Modules::get('member');
if ($mMember->isLogged() == true) {
$error->prefix = $this->getErrorText('FORBIDDEN');
$error->message = $this->getErrorText('FORBIDDEN_DETAIL', [
'code' => $this->getErrorText('FORBIDDEN_CODE/' . $message),
]);
} else {
$error->prefix = $this->getErrorText('REQUIRED_LOGIN');
}
return $error;
default:
return parent::error($code, $message, $details);
}
}
/**
* 관리자모듈이 설치된 이후 최고관리자(회원고유값=1) 권한을 설정한다.
*
* @param string $previous 이전설치버전 (NULL 인 경우 신규설치)
* @param object $configs 모듈설정
* @return bool|string $success 설치성공여부
*/
public function install(string $previous = null, object $configs = null): bool|string
{
$success = parent::install($previous);
if ($success == true) {
$this->db()
->replace($this->table('administrators'), [
'member_id' => 1,
'language' => $this->getLanguage(),
'permissions' => 'true',
])
->execute();
}
return $success;
}
}