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

rbac\DbManager::getRolesByUser() returns not only the Roles but the assigned Permissions too. #7656

Closed
iromk opened this issue Mar 10, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@iromk
Copy link

iromk commented Mar 10, 2015

I expected that method (because of unambiguous name) gives me only Roles for user_id.
In fact it doesn't count on value of the item_type.
I suppose it could be fixed as follows:

        $query = (new Query)->select('b.*')
            ->from(['a' => $this->assignmentTable, 'b' => $this->itemTable])
            ->where('{{a}}.[[item_name]]={{b}}.[[name]]')
            ->andWhere(['a.user_id' => (string) $userId])
            // FIX: and only the roles
           ->andWhere('{{b}}.[[type]]='.Item::TYPE_ROLE);
@samdark samdark added the status:to be verified Needs to be reproduced and validated. label Mar 10, 2015
@samdark samdark added this to the 2.0.4 milestone Mar 10, 2015
@samdark samdark self-assigned this Mar 10, 2015
@samdark samdark added the type:bug Bug label Mar 10, 2015
@samdark samdark removed the status:to be verified Needs to be reproduced and validated. label Apr 20, 2015
@samdark
Copy link
Member

samdark commented Apr 20, 2015

Fixed. Thanks for report.

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

No branches or pull requests

2 participants