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

Don’t show misleading permissions when editing a role without any permissions. #2671

Merged
merged 1 commit into from May 13, 2015

Conversation

tburry
Copy link
Contributor

@tburry tburry commented Apr 9, 2015

If there are no entries for a role in GDN_Permission then editing that role shows default permissions. This is misleading because that role really has no permissions. This fix makes the role show no permission so that admins know to fix the role.

This is an issue that usually won’t occur unless the data is incorrect from something like an import.

…missions.

If there are no entries for a role in `GDN_Permission` then editing that role shows default permissions. This is misleading because that role really has no permissions. This fix makes the role show no permission so that admins know to fix the role.

This is an issue that usually won’t occur unless the data is incorrect from something like an import.
@tburry
Copy link
Contributor Author

tburry commented Apr 9, 2015

The best way to test this fix would be to do the following:

  1. Delete all everything in GDN_Permission for a given role ID.
  2. Edit that role and make sure there are no permissions.
  3. Make sure saving the role still works.
  4. Do some basic regression testing on role editing.

@initvector
Copy link
Contributor

Everything seems to checkout

  • Editing a role with no permission rows gives you an empty permission grid (no defaults)
  • Editing a role with permission rows still properly populates the permission grid
  • Adding a new role gives you default permissions pre-populated
  • Deleting a role is unaffected
  • Editing attributes of a role not related to permissions (name, description) is still functional

High-five on making that foreach loop a little less confusing.

@initvector initvector self-assigned this May 13, 2015
initvector added a commit that referenced this pull request May 13, 2015
Don’t show misleading permissions when editing a role without any permissions.
@initvector initvector merged commit c7b6e02 into master May 13, 2015
@linc linc deleted the hotfix/edit-no-permission branch May 27, 2015 18:45
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

Successfully merging this pull request may close these issues.

None yet

2 participants