in reply to Re: CGI::Application with access control on certain functions/run modes
in thread CGI::Application with access control on certain functions/run modes
"One approach is to nest CGI::Applications within each other. Then put authorization on the individual C::As"I see that this would be the prefered way when your individual C::As implement a functionality which requires new run-modes anyways or you don't mind overwritting/rewriting some runmode with altered functionality. But that's exactly where my problem is:
"In general I'd suggest that scattering authorization logic around is somewhat fragile"Agreed, but in a case like this the only required steps is to check if a privileged "run-mode set" has been loaded and if authentification has been performed.
This should catch configuration mistakes in regards to authorization, e.g. if one forgot to enable access control to the admin.pl. This is following the logic of "if there was no authentification there can't be authorization, as we know it should be restricted in someway (not caring about the specific groups/users to be allowed)".if ($self->param('RESTRICTED')) { return _no_auth() unless defined($ENV{UserName}); }
if ($self->param('RESTRICTED')) { # add the infos for admins only }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: CGI::Application with access control on certain functions/run modes
by dragonchild (Archbishop) on Mar 28, 2004 at 17:22 UTC |