liquidvotingio / decidim-module-liquidvoting

GNU Affero General Public License v3.0
4 stars 0 forks source link

Only render delegation if logged in #15

Closed davefrey closed 3 years ago

davefrey commented 3 years ago

Since delegation functionality only makes sense in the context of a user, I've restricted those buttons to only render when the user is logged in. (otherwise the page breaks on current_user.email).

If we wanted, we could display the current delegation information when not logged in, but it erring on the side of privacy until/if we decide to always show delegator/delegate.

Using the logic table in #14 I'm implementing as:

if current_user
  if session[:delegated_to]   # using this to mean "delegation exists AND I am that delegator"
    show delegation AND delete delegation button
  else
    show chose delegate button

Closes #14