Adding on-the-fly page authentication with page variables

edited May 2012 in Modules
With some CMS systems it's possible to allow the administrator to set whether a CMS page requires authentication. Say, checking a box will force basic authentication, or maybe selecting several would require all checked permissions to be required.

If such a variable(s) were added to $config['layout_fields']['main'], how best would the value be intercepted and acted on in Fuel?

I can think of:

1) Adding a conditional to the (main) layout view that tests for the variable.
2) Adding a hook method to redirect

1) is fine if the purpose is to encourage "membership" sign up and it's useful to show a "teaser" page (ie part of the page content, but not all), but is less than efficient if the intention is to 401/403 the user (which would be more of a controller interception).
2) Depending on the hook, this might be more efficient (if 401/403 were intended).

Is there another method I'm missing? If the hook option, which hook could capture page vars earliest?

Comments

Sign In or Register to comment.