mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Show a notice above the permission editor, that permissions can depend on each other
Related to issue #435
This commit is contained in:
parent
84c111ac7c
commit
4b88de9316
3 changed files with 14 additions and 0 deletions
|
@ -45,6 +45,9 @@ class PermissionsType extends AbstractType
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'show_legend' => true,
|
'show_legend' => true,
|
||||||
'show_presets' => false,
|
'show_presets' => false,
|
||||||
|
'show_dependency_notice' => static function (Options $options) {
|
||||||
|
return !$options['disabled'];
|
||||||
|
},
|
||||||
'constraints' => static function (Options $options) {
|
'constraints' => static function (Options $options) {
|
||||||
if (!$options['disabled']) {
|
if (!$options['disabled']) {
|
||||||
return [new NoLockout()];
|
return [new NoLockout()];
|
||||||
|
@ -60,6 +63,7 @@ class PermissionsType extends AbstractType
|
||||||
{
|
{
|
||||||
$view->vars['show_legend'] = $options['show_legend'];
|
$view->vars['show_legend'] = $options['show_legend'];
|
||||||
$view->vars['show_presets'] = $options['show_presets'];
|
$view->vars['show_presets'] = $options['show_presets'];
|
||||||
|
$view->vars['show_dependency_notice'] = $options['show_dependency_notice'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
|
|
|
@ -89,6 +89,10 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if show_dependency_notice %}
|
||||||
|
<small class="text-muted mb-1 d-inline-block">{% trans %}permission.legend.dependency_note{% endtrans %}</small>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
{% for group in form %}
|
{% for group in form %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|
|
@ -12047,5 +12047,11 @@ Please note, that you can not impersonate a disabled user. If you try you will g
|
||||||
<target>Permissions required by other permissions were missing. This was corrected. Please check if the permissions are as you intended.</target>
|
<target>Permissions required by other permissions were missing. This was corrected. Please check if the permissions are as you intended.</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="gjo2ZK7" name="permission.legend.dependency_note">
|
||||||
|
<segment>
|
||||||
|
<source>permission.legend.dependency_note</source>
|
||||||
|
<target>Please note that some permission operations depend on each other. If you encounter a warning that missing permissions were corrected and a permission was set to allow again, you have to set the dependent operation to forbid too. The dependents can normally found right of an operation.</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue