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

Menu role doesn't restrict access #52

Closed
cod3rshotout opened this issue Feb 2, 2022 · 1 comment
Closed

Menu role doesn't restrict access #52

cod3rshotout opened this issue Feb 2, 2022 · 1 comment

Comments

@cod3rshotout
Copy link

cod3rshotout commented Feb 2, 2022

I have defined these roles:

  • tenant
  • patient

Then, I have created a menu called Patients:

class Patients
{
    public function make(Builder $menu)
    {
        $item = $menu->add('patients.title', [
            'icon' => 'fa-user-injured',
            'role' => 'tenant',
            'order' => 103
        ]);

        $item->add('patients.list.title', [
            'route' => 'socialthess.patients.index',
            'active' => 'socialthess.patients.index',
        ]);
    }
}

as you can see I have specified the role tenant, but if I access as an user which have the role patient I can see the menu.

Also, I would like to ask another question: when I signin as patient user and try to access to the datatable I get:

Symfony\Component\HttpKernel\Exception\HttpException

This is the content of the setUp function:

public function setUp()
{
    $this->permissions(['invites_crud'])
        ->order('id', 'desc');
}

The user have that permission, but for some reason the data aren't returned, this happen just for invites_crud user, the admin doesn't have any issues ..
what I did wrong?

@sebastienheyd
Copy link
Owner

First point has been fixed on 7.12.0

Second point is certainly not a permission issue on the datatable component, if the user does not have the permission the datatable will be replaced by a simple message that the user has not the permission to display the datatable.

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

2 participants