Giter Site home page Giter Site logo

Comments (8)

ihorchepurnyi avatar ihorchepurnyi commented on May 28, 2024

Hi, in your grid missing the view link - assignments grid.
This link opens the following page - assign roles page
On this page you can assign all available roles to user.

from yii2-rbac.

ihorchepurnyi avatar ihorchepurnyi commented on May 28, 2024

In your case for user with ID=66 this link looks as rbac/assignment/view?id=66

from yii2-rbac.

ihorchepurnyi avatar ihorchepurnyi commented on May 28, 2024

Also if you override the gridViewColumns property you should add the view link to your array as follows:

return [
    'modules' => [
        'admin' => [
            'class' => 'app\modules\admin\Module',
            'modules' => [
                'rbac' => [
                    'class' => 'yii2mod\rbac\Module',
                    'controllerMap' => [
                        'assignment' => [
                            'class' => 'yii2mod\rbac\controllers\AssignmentController',
                            'gridViewColumns' => [
                                 'id',
                                 'username',
                                 'email', 
                                // you should add this code
                                [
                                      'class' => 'yii\grid\ActionColumn',
                                      'template' => '{view}'
                                ]
                             ]
                        ]
                    ]
                ],
            ]
        ],
    ],
  'components' => [
         'authManager' => [
            'class' => 'yii\rbac\DbManager',
            'defaultRoles' => ['guest', 'user']
        ],
    ]
];

from yii2-rbac.

mixnblend avatar mixnblend commented on May 28, 2024

Hey hey @igor-chepurnoi Thanks for getting back to me so quickly.

Yeah I see,:) Since the action column never changes (i.e. it's just the view link and no others on that grid, would it not be an idea to ArrayHelper::merge the action column with that gridViewColumns array on setup? That way, if it is left out of the gridViewColumns config array, it will be merged in anyway, and if it is defined, then it can be overridden?

Thanks again for putting together such an easy to use module, and thank you again for getting back to me so quickly. Hope this finds you well.

from yii2-rbac.

ihorchepurnyi avatar ihorchepurnyi commented on May 28, 2024

Since the action column never changes (i.e. it's just the view link and no others on that grid, would it not be an idea to ArrayHelper::merge the action column with that gridViewColumns array on setup?

Resolved by 3219ffd

from yii2-rbac.

ihorchepurnyi avatar ihorchepurnyi commented on May 28, 2024

I create the new release 1.8 with this 3219ffd changes. Update your package by composer update.
Thanks.

from yii2-rbac.

mixnblend avatar mixnblend commented on May 28, 2024

Thank you so so much:)

from yii2-rbac.

ihorchepurnyi avatar ihorchepurnyi commented on May 28, 2024

You are welcome :)

from yii2-rbac.

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.