Giter Site home page Giter Site logo

Comments (6)

alexusmai avatar alexusmai commented on August 16, 2024

Hi, thank you.
I'll think about this functionality.

from laravel-file-manager.

ahmedkandel avatar ahmedkandel commented on August 16, 2024

Thanks @alexusmai i though of a work around until it gets done in Vue frontend as following:

<script>
$(document).ready(function () {

            @if ( ! auth()->user()->can('manageFiles') )

                //Remove unused menu items
                window.fm.$store.state.fm.settings.contextMenu = [
                    [
                        {
                            name: 'open',
                            icon: 'far fa-folder-open',
                        },
                        {
                            name: 'audioPlay',
                            icon: 'fas fa-play',
                        },
                        {
                            name: 'videoPlay',
                            icon: 'fas fa-play',
                        },
                        {
                            name: 'view',
                            icon: 'fas fa-eye',
                        },
                        {
                            name: 'select',
                            icon: 'fas fa-check',
                        },
                        @if ( auth()->user()->can('downloadFiles') )
                            {
                                name: 'download',
                                icon: 'fas fa-download',
                            },
                        @endif
                    ]
                ];

            @endif

 });
</script>

from laravel-file-manager.

vnayak-bhatt avatar vnayak-bhatt commented on August 16, 2024

is there any update on the ACL or Permissions?

from laravel-file-manager.

alexusmai avatar alexusmai commented on August 16, 2024

is there any update on the ACL or Permissions?

No, I have no time ...

from laravel-file-manager.

ahmedkandel avatar ahmedkandel commented on August 16, 2024

I have extended settings adding "canDownload" and "canManage" properties here that can be defined as javascript variable in you blade template, so you have full control on ACL as following:

<script>
   var fmSettings = {
       showFullScreen: false,
       showAbout: false,
       showDiskList: false,
       showBreadcrumb: false,
       viewType: 'grid',
       showProperties: false,
       showSize: true,
       canDownload: {{ auth()->user()->can('downloadFiles) ? 'true' : 'false' }},
       canManage: {{ auth()->user()->can('manageFiles') ? 'true' : 'false' }},
   }
</script>
<script src="{{ asset('js/file-manager.js') }}"></script>

Also starting from v 2.4 we can merge those extra setting to the original settings.

@alexusmai please let me know if you are interested in a PR.

from laravel-file-manager.

alexusmai avatar alexusmai commented on August 16, 2024

Hi, thank you.
But!! I'll need to apply ACL rules only on the frontend, because my package may be using in SPA and Laravel would be only as API.
I thinked about this feature, but I'll need time for do it.

from laravel-file-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.