Skip to content

How to combine ghost-access with custom permissions #220

Description

@ariefbayu

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' => ['@'],
        ],
    ],

],

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions