Skip to content

Commit

Permalink
update: permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhquochan committed Jan 9, 2024
1 parent 2c763ac commit cc2e3b7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
10 changes: 9 additions & 1 deletion config/permissions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

return [

[
'name' => 'elFinder Media',
'flag' => 'elfinder.index',
],
[
'name' => 'elFinder Settings',
'flag' => 'elfinder.settings',
'parent_flag' => 'elfinder.index'
],
];
16 changes: 8 additions & 8 deletions resources/lang/en/elfinder.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

return [
'menu_name' => 'ElFinder Media',
'elfinder' => 'ElFinder',
'menu_name' => 'elFinder Media',
'elfinder' => 'elFinder',
'settings' => [
'title' => 'ElFinder',
'description' => 'View and update the ElFinder settings',
'title' => 'elFinder',
'description' => 'View and update the elFinder settings',
'form' => [
'enable_editor' => 'Enable ElFinder for Editor',
'enable_editor' => 'Enable elFinder for Editor',
'replace_default_media' => 'Replace default media manager',
'replace_default_media_helper' => 'You should set base path for ElFinder is `storage` to view uploaded files in default media manager.',
'replace_default_media_helper' => 'You should set base path for elFinder is `storage` to view uploaded files in default media manager.',
'base_path' => 'Base Path',
'base_path_helper' => 'The base path for ElFinder, relative to the public folder. Example: `files` your upload files will store in `public/files` folder.',
'base_path_helper' => 'The base path for elFinder, relative to the public folder. Example: `files` your upload files will store in `public/files` folder.',
'base_path_invalid' => 'Field :attribute must not starts with dot (.) or slash (/) character and ends with slash (/) character.',
'base_path_does_not_starts_with_vendor_or_themes' => 'Field :attribute must not starts with `themes` or `vendor`.',
],
'editor_not_support' => 'ElFinder does not support :editor. Only CKEditor is supported.',
'editor_not_support' => 'elFinder does not support :editor. Only CKEditor is supported.',
],
];
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Support\Facades\Route;

AdminHelper::registerRoutes(function () {
Route::group(['prefix' => 'elfinder', 'as' => 'elfinder.', 'permission' => false], function () {
Route::group(['prefix' => 'elfinder', 'as' => 'elfinder.', 'permission' => 'elfinder.index'], function () {
Route::get('', [ElFinderController::class, 'index'])
->name('index');

Expand Down
2 changes: 1 addition & 1 deletion src/Providers/ElFinderServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function boot(): void
'icon' => 'ti ti-folder',
'name' => $replaceDefaultMedia ? 'core/media::media.menu_name' : 'plugins/elfinder::elfinder.menu_name',
'route' => 'elfinder.index',
'permissions' => ['media.index'],
'permissions' => ['elfinder.index'],
]);
});
}
Expand Down

0 comments on commit cc2e3b7

Please sign in to comment.