Giter Site home page Giter Site logo

nova-bouncer's People

Contributors

calvinps avatar stylecibot avatar yakidahan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nova-bouncer's Issues

Forbid everything but edit one

Hello, first sorry. But I don't understand how it works at all.

How can forbid a model, but let the user to edit a model id? I tried creating two abilities. One to forbid evertything in the model, and another ability to edit a model id. But not working, is always forbidden.

Thanks

Can not install with silber/bouncer v1.0.0-rc.8

Using version ^0.4.0 for yadahan/nova-bouncer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for yadahan/nova-bouncer ^0.4.0 -> satisfiable by yadahan/nova-bouncer[v0.4.0].
- yadahan/nova-bouncer v0.4.0 requires silber/bouncer v1.0.0-rc.4|v1.0.0-rc.5|v1.0.0-rc.6|v1.0.0-rc.7 -> satisfiable by silber/bouncer[v1.0.0-rc.4, v1.0.0-rc.5, v1.0.0-rc.6, v1.0.0-rc.7] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

"No hint path defined" crash

I've installed nova-bouncer as per the readme in a vanilla Nova app. It crashes with

No hint path defined for [bouncer-tool]. (View: /Users/marcus/app/nova/resources/views/layout.blade.php) (View: /Users/marcus/app/nova/resources/views/layout.blade.php)

How to change the sidebar group name?

I would like to move the abilities and roles sidebar items under my Users group instead of the Bouncer group. I discovered that it appears in resources/views/navigation.blade.php as a translated item. This makes it a bit hard to get at, and subverts Nova's own $group property that's intended for this purpose (and which is itself translatable).

requires bouncer dev-master

Should also allow:

composer require silber/bouncer v1.0.0-rc.3

maybe (not tested):

...
"require": {
        "php": "^7.1.3",
        "laravel/nova": "*",
        "silber/bouncer": "dev-master|v1.0.*"
},
...

Support Custom Role & Ability Models

Bouncer has support for extending the base Role and Ability classes, but it seems that the relationships of extended bouncer classes don't load properly.

Specifically, I am using an extended Role class and when I go to the index page for my role I don't see any of the abilities. I found that if I chance the public static $model = 'Silber\Bouncer\Database\Role' to public static $model = 'App\Models\Role' (my custom role class) in Yadahan\BouncerTool\Nova\Role then the role's abilities will show up.

Maybe you could update it so that custom role/ability classes can be defined in config/bouncer-tool.php and used as the public static $model in Yadahan\BouncerTool\Nova\Role and Yadahan\BouncerTool\Nova\Ability?

If it helps, the reason the abilities don't load in my case is because the mysql query includes the WHERE clause permissions.entity_type = 'Silber\Bouncer\Database\Role', but none of my permissions match that entity_type since I'm using a different model.

Refresh cache

We have the Bouncer cache permanently active. So, after we made changes to roles, abilities and permissions, we need to refresh the cache.

Is there a possibility that the cache is automatically refreshed, when we change one of the above?

Feature request: 'Applied to' field for Roles resource

I've been trying to figure out how to add a field that displays all the models that a Role has been applied to. I know it should be roughly the inverse of the MorphToMany used in my User resource:

            MorphToMany::make('Roles', 'roles', Role::class)->fields(
                static fn() => [
                    Text::make('Scope')
                        ->sortable()
                        ->rules('nullable', 'integer'),
                ]
            ),

However, I'm failing dismally at trying to see how to define a field for "things that this Role is applied to" since obviously it doesn't have a single class name that I can give it. I can see the records in the assigned_roles table that represent this linkage, but can't spot a corresponding relation in Bouncer to use in the MorphToMany.

I'm hoping that you have a better understanding of this!

Sidebar Menu

I've installed bouncer and then followed the instructions to install Nova-Bouncer, but still, I am not seeing it show up in the sidebar. Is there something I'm missing from the install process?

Only owner

Hello, thanks for your tool! ๐Ÿ˜„

How can I create an Ability to edit/view just your own user? I'm unable to get it.

Thanks!

Error when assigning a Role to a User (not using scopes or Entity ids)

I'm attempting to attach a Role to a User and get the following error message:

joxi_screenshot_1541087996548

{
    "message": "SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"id\" does not exist\nLINE 1: ...\"role_id\", \"entity_type\") values ($1, $2, $3) returning \"id\"\n                                                                   ^ (SQL: insert into \"assigned_roles\" (\"entity_id\", \"role_id\", \"entity_type\") values (14, 1, App\\User) returning \"id\")",

We don't have scopes enabled on our system, perhaps that is causing problems?

Target class [translator] doesn't exist after publishing config

It seems the timing of the config being loaded when it's in the application's config directory is too early to use the __() function.

You should probably move the translation work out to your other classes, closer to where and when it's needed, rather than have it happen inside the config file itself.

Forbidden and Scope in attach not updating

After attach an ability to a role I'm able to set the Forbidden check and Scope field. But once saved the resource is giving always a Forbidden in red.

Also when I want to update Forbidden is always unchecked and also scope.

Thanks!

Ability to show/hide sections

Thanks for the great package.

I was wondering whether there's a way to show/hide sidebar sections generated by Tools based on roles or abilities?

As an example, I use Nova Log Viewer on a CMS and only want users with the System Administrator role be able to manage logs.

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.