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_role creates a new role instead of just assigning #596

Open
lperry65 opened this issue Jan 10, 2024 · 0 comments
Open

Add_role creates a new role instead of just assigning #596

lperry65 opened this issue Jan 10, 2024 · 0 comments

Comments

@lperry65
Copy link

First, thanks for making this gem, for the most part it does what I need :)

I've just started using rolify and have read the documentation, I'm not finding some of it very intuitive tbh.

The create_role does what I'd expect, but add_role which I would have thought should be named assign_role creates a new role if the role does not exist. This feels wrong to me, I'd expect an error telling me that the role does not exist and only allow me to assign roles that have previously been defined.

It's also strange that roles are automatically deleted when not currently being used, but at least there is a config to fix that even though I think the default should be false.

I'm sure there must be a use case for the auto creation of the role but it feels wrong that this is the default behaviour, can we please at least have a config like the config.remove_role_if_empty = false maybe something like config.skip_create_role = true that stops roles from being created with add_role.

Thanks,
Lee.

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

1 participant