]> BookStack Code Mirror - bookstack/commitdiff
Added image view access notice to role form
authorDan Brown <redacted>
Tue, 6 Sep 2022 16:20:35 +0000 (17:20 +0100)
committerDan Brown <redacted>
Tue, 6 Sep 2022 16:20:35 +0000 (17:20 +0100)
Added to clarify the role permission in scenarios where users may have
not read the docs site to understand image access control.

Related to #3688

resources/lang/en/settings.php
resources/views/settings/roles/parts/form.blade.php
tests/Permissions/RolesTest.php

index 9dbd96c5af30b95731d44a313ee79f3f31226307..ea4228488f5863924ceee0cfaca997e732f45612 100755 (executable)
@@ -161,6 +161,7 @@ return [
     'roles_system_warning' => 'Be aware that access to any of the above three permissions can allow a user to alter their own privileges or the privileges of others in the system. Only assign roles with these permissions to trusted users.',
     'role_asset_desc' => 'These permissions control default access to the assets within the system. Permissions on Books, Chapters and Pages will override these permissions.',
     'role_asset_admins' => 'Admins are automatically given access to all content but these options may show or hide UI options.',
+    'role_asset_image_view_note' => 'This relates to visibility within the image manager. Actual access of uploaded image files will be dependant upon system image storage option.',
     'role_all' => 'All',
     'role_own' => 'Own',
     'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to',
index 73d6a03d09b60d1036d93f63b4343b8bee255846..5937919973d83a2bcc9e1c28b9922288c3fb1b95 100644 (file)
                     <a href="#" permissions-table-toggle-all-in-row class="text-small text-primary">{{ trans('common.toggle_all') }}</a>
                 </td>
                 <td>@include('settings.roles.parts.checkbox', ['permission' => 'image-create-all', 'label' => ''])</td>
-                <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
+                <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}<sup>1</sup></small></td>
                 <td>
                     @include('settings.roles.parts.checkbox', ['permission' => 'image-update-own', 'label' => trans('settings.role_own')])
                     <br>
                 </td>
             </tr>
         </table>
+
+        <div>
+            <p class="text-muted text-small px-m">
+                <sup>1</sup> {{ trans('settings.role_asset_image_view_note') }}
+            </p>
+        </div>
     </div>
 </div>
\ No newline at end of file
index 3604a3cac4b95942cffafeccc678afe3abf9a624..b992bfecc3f19fe8df717ba5a54904c295557366 100644 (file)
@@ -163,6 +163,14 @@ class RolesTest extends TestCase
         $this->assertEquals($this->user->id, $roleA->users()->first()->id);
     }
 
+    public function test_image_view_notice_shown_on_role_form()
+    {
+        /** @var Role $role */
+        $role = Role::query()->first();
+        $this->asAdmin()->get("/settings/roles/{$role->id}")
+            ->assertSee('Actual access of uploaded image files will be dependant upon system image storage option');
+    }
+
     public function test_copy_role_button_shown()
     {
         /** @var Role $role */