Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to combine ghost-access with custom permissions #220

Open
ariefbayu opened this issue Dec 10, 2020 · 0 comments
Open

How to combine ghost-access with custom permissions #220

ariefbayu opened this issue Dec 10, 2020 · 0 comments

Comments

@ariefbayu
Copy link

I have controllers that has ghost-access already configured, how do I add another action with certain permission that is not controlled by action?

Example, I have CommandController.php and ghost-access has if ( User::canRoute($route) ) checking. But, I need to have another permission, eg: 'has feature xyz' that allowed user to open actionTools.

How do I configure my controller?

I set this in behaviours(), but still, ghost-access disallowed me to access.

'access' => [
    'class' => AccessControl::className(),
    'only' => ['has feature xyz'],
    'rules' => [
        [
            'actions' => [
                'tools'
            ],
            'allow' => true,
            'roles' => ['@'],
        ],
    ],

],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant