mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-18 18:02:15 +09:00
<action>에 퍼미션 속성 추가
승인 권한 (grant)도 퍼미션 체크를 할 수 있도록 추가
This commit is contained in:
parent
9713e99144
commit
f224a4aea0
3 changed files with 69 additions and 30 deletions
|
|
@ -839,13 +839,13 @@ class moduleModel extends module
|
|||
else $permission_list[] = $permissions;
|
||||
|
||||
$buff[] = '$info->permission = new stdClass;';
|
||||
|
||||
$info->permission = new stdClass();
|
||||
|
||||
foreach($permission_list as $permission)
|
||||
{
|
||||
$action = $permission->attrs->action;
|
||||
$target = $permission->attrs->target;
|
||||
|
||||
|
||||
$info->permission->{$action} = $target;
|
||||
$info->permission_check->{$action}->key = $permission->attrs->check_var ?: '';
|
||||
$info->permission_check->{$action}->type = $permission->attrs->check_type ?: '';
|
||||
|
|
@ -863,6 +863,7 @@ class moduleModel extends module
|
|||
|
||||
$buff[] = '$info->menu = new stdClass;';
|
||||
$info->menu = new stdClass();
|
||||
|
||||
foreach($menu_list as $menu)
|
||||
{
|
||||
$menu_name = $menu->attrs->name;
|
||||
|
|
@ -885,20 +886,39 @@ class moduleModel extends module
|
|||
{
|
||||
if(is_array($actions)) $action_list = $actions;
|
||||
else $action_list[] = $actions;
|
||||
|
||||
|
||||
if(!isset($info->permission))
|
||||
{
|
||||
$buff[] = '$info->permission = new stdClass;';
|
||||
$info->permission = new stdClass();
|
||||
}
|
||||
|
||||
$buff[] = '$info->action = new stdClass;';
|
||||
$info->action = new stdClass();
|
||||
|
||||
foreach($action_list as $action)
|
||||
{
|
||||
$name = $action->attrs->name;
|
||||
|
||||
|
||||
// <action permission="...">
|
||||
if($action->attrs->permission)
|
||||
{
|
||||
$info->permission->$name = $action->attrs->permission;
|
||||
$info->permission_check->$name->key = $action->attrs->check_var ?: '';
|
||||
$info->permission_check->$name->type = $action->attrs->check_type ?: '';
|
||||
|
||||
$buff[] = sprintf('$info->permission->%s = \'%s\';', $name, $info->permission->$name);
|
||||
$buff[] = sprintf('$info->permission_check->%s->key = \'%s\';', $name, $info->permission_check->$name->key);
|
||||
$buff[] = sprintf('$info->permission_check->%s->type = \'%s\';', $name, $info->permission_check->$name->type);
|
||||
}
|
||||
|
||||
$type = $action->attrs->type;
|
||||
$grant = $action->attrs->grant?$action->attrs->grant:'guest';
|
||||
$standalone = $action->attrs->standalone=='false'?'false':'true';
|
||||
$ruleset = $action->attrs->ruleset?$action->attrs->ruleset:'';
|
||||
$method = $action->attrs->method?$action->attrs->method:'';
|
||||
$check_csrf = $action->attrs->check_csrf=='false'?'false':'true';
|
||||
|
||||
|
||||
$index = $action->attrs->index;
|
||||
$admin_index = $action->attrs->admin_index;
|
||||
$setup_index = $action->attrs->setup_index;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue