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
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:
Closes #14