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

Node API is used to find groups/roles #1316

Open
rymsha opened this issue Nov 10, 2022 · 0 comments
Open

Node API is used to find groups/roles #1316

rymsha opened this issue Nov 10, 2022 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@rymsha
Copy link
Contributor

rymsha commented Nov 10, 2022

proncipal.js

        // users and groups have their keys as _id, but roles have them stored as key
        var principals = noKeys ? [] : common.queryAll({
            query:
                common.createQueryByField('_id', keys) +
                ' OR ' +
                common.createQueryByField('key', keys)
        }).hits;

This is incorrect. It is a wrong assumption that principal-key is a node _id
It is also wrong that roles have key field.

This method also dangerously returns undefined when nothing is found leading to various problems.

findPrincipals method should be used instead

@rymsha rymsha added the Bug Something isn't working label Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants