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

Add parameter to pass in a list of Role names for use in export #295

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tim-d-blue
Copy link

This provides a simpler method to combine multiple roles on export. Given a simple list of roles, when export is called a list of roles can be provided and the export will combine the roles and filter fields appropriately. Therefore dynamic role combination is available. Blacklist roles will override whitelist roles.

@bintoro
Copy link
Member

bintoro commented Oct 31, 2015

I like the idea, but couldn't we repurpose the existing role parameter instead of introducing a parallel parameter roles?

Something like:

if isinstance(role, Role):
    role = (role,)

and then the rest of the code could just assume it's an iterable of roles.

Btw, the __name__ attribute on functions has been around at least since Python 2.5, so I'm thinking this whole thing:

if role and ((hasattr(role.function, "func_name") and
              role.function.func_name == "whitelist")
             or (hasattr(role.function, "__name__") and
                 role.function.__name__ == "whitelist")):

can probably be simplified to:

if role and role.function.__name__ == "whitelist"

@berislavlopac
Copy link

Any updates on this PR?

@lkraider lkraider closed this May 23, 2017
@lkraider lkraider reopened this May 23, 2017
@lkraider lkraider changed the base branch from development to master May 31, 2017 02:09
@lkraider
Copy link
Contributor

lkraider commented Mar 3, 2018

Needs to be refactored according to suggestions before pulling it in.

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

Successfully merging this pull request may close these issues.

None yet

4 participants