jaliss/securesocial — Issue #24: Deadbolt integration breaks when using deadbolt.restrict tag
Author: bnahas
Created: 2012-01-22 20:41:17+00:00
State: open

This is related to issue #23.

If I attempt to use the deadbolt.restrict tag on a template where the user is not logged in, then I get an exception because SecureSocial attempts to redirect to the login page after the template has already sent content. I'm trying to use these tags on a page that has different content/buttons if the user is logged in or not. This happens because the DeadboltHelper.beforeRoleCheck calls checkAccess, which does the redirect when the user is not logged in.

This may be as designed. However, I don't think it's a good idea to have template tags potentially call a redirect. I think the deadbolt integration needs to be cleaned up a bit if possible. I think this can work better if the changes suggested in issue #23 are fixed.

I can avoid this issue by using deadbolt.roleHolderPresent around the deadbolt.restrict tag for now.