mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Disable unsafe selections when the default value for a grant is manager
This commit is contained in:
parent
a90f991f6c
commit
ba12e1b3a4
2 changed files with 5 additions and 0 deletions
|
|
@ -174,11 +174,13 @@ class ModuleAdminModel extends Module
|
||||||
|
|
||||||
// Get a permission group granted to the current module
|
// Get a permission group granted to the current module
|
||||||
$selected_group = array();
|
$selected_group = array();
|
||||||
|
$default_xml_grant = array();
|
||||||
$default_grant = array();
|
$default_grant = array();
|
||||||
foreach ($grant_list as $key => $val)
|
foreach ($grant_list as $key => $val)
|
||||||
{
|
{
|
||||||
if (!empty($val->default))
|
if (!empty($val->default))
|
||||||
{
|
{
|
||||||
|
$default_xml_grant[$key] = $val->default;
|
||||||
$default_grant[$key] = $val->default;
|
$default_grant[$key] = $val->default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -203,6 +205,7 @@ class ModuleAdminModel extends Module
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Context::set('selected_group', $selected_group);
|
Context::set('selected_group', $selected_group);
|
||||||
|
Context::set('default_xml_grant', $default_xml_grant);
|
||||||
Context::set('default_grant', $default_grant);
|
Context::set('default_grant', $default_grant);
|
||||||
Context::set('module_srl', $module_srl);
|
Context::set('module_srl', $module_srl);
|
||||||
// Extract admin ID set in the current module
|
// Extract admin ID set in the current module
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,11 @@
|
||||||
<label for="{$grant_name}_default" class="x_control-label">{$grant_item->title}</label>
|
<label for="{$grant_name}_default" class="x_control-label">{$grant_item->title}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<select name="{$grant_name}_default" id="{$grant_name}_default" class="grant_default">
|
<select name="{$grant_name}_default" id="{$grant_name}_default" class="grant_default">
|
||||||
|
<!--@if($default_xml_grant[$grant_name] !== 'manager')-->
|
||||||
<option value="0" <!--@if(($default_grant[$grant_name] ?? '') == 'all')-->selected="selected"<!--@end-->>{$lang->grant_to_all}</option>
|
<option value="0" <!--@if(($default_grant[$grant_name] ?? '') == 'all')-->selected="selected"<!--@end-->>{$lang->grant_to_all}</option>
|
||||||
<option value="-1" <!--@if(($default_grant[$grant_name] ?? '') == 'member' || ($default_grant[$grant_name] ?? '') == 'site')-->selected="selected"<!--@end-->>{$lang->grant_to_login_user}</option>
|
<option value="-1" <!--@if(($default_grant[$grant_name] ?? '') == 'member' || ($default_grant[$grant_name] ?? '') == 'site')-->selected="selected"<!--@end-->>{$lang->grant_to_login_user}</option>
|
||||||
<option value="-4" <!--@if(($default_grant[$grant_name] ?? '') == 'not_member')-->selected="selected"<!--@end-->>{$lang->grant_to_non_login_user}</option>
|
<option value="-4" <!--@if(($default_grant[$grant_name] ?? '') == 'not_member')-->selected="selected"<!--@end-->>{$lang->grant_to_non_login_user}</option>
|
||||||
|
<!--@endif-->
|
||||||
<option value="-3" <!--@if(($default_grant[$grant_name] ?? '') == 'manager')-->selected="selected"<!--@end-->>{$lang->grant_to_admin}</option>
|
<option value="-3" <!--@if(($default_grant[$grant_name] ?? '') == 'manager')-->selected="selected"<!--@end-->>{$lang->grant_to_admin}</option>
|
||||||
<option value="" <!--@if(($default_grant[$grant_name] ?? '') == 'group')-->selected="selected"<!--@end-->>{$lang->grant_to_group}</option>
|
<option value="" <!--@if(($default_grant[$grant_name] ?? '') == 'group')-->selected="selected"<!--@end-->>{$lang->grant_to_group}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue