Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hello Monks!

I'm about to start my college project. It will be some sort of Intranet/B2B application. On one side you have company that can add products, check orders, manage dealers ...etc. and on other side you have the dealers.

The method that I'm using at this point (for existing applications) - is to have an base class which is inherited by all modules that contain Runmodes (CGI::Application term). Among things like setting up a DB connection and configuring some of the plug ins (sessions, templates path ...) in cgiapp_prerun (method which is called after all configuration but before the specific runmode is executed) I call a method named authorize.

# Inside base module sub cgiapp_prerun { my ($self, $run_mode) = @_; unless( $self->authorize() ){ # Error $self->prerun_mode('UNAUTHORIZED'); } } sub authorize { my $self = shift; return $self->session->param('logged-in'); }
Each of modules that inherits from this one can override the authorize method in case additional checks are to be made (say if user has admin rights). Obviously methods are grouped in modules by logical relationship and they basically make one object/class on it's own.

How does this looks to you folks? What methods are you using?

I will also need to implement a bit more complicated checking as b2b application will be just part of the intranet application (kind of module/plug-in for it). So some grouping of users will need to take place, as I imagine not everyone will be able to admin everything (some admins will be admins for entire intranet, some for b2b and some for some other module).

As I haven't yet worked on projects of this size, I would appreciate any recommendations or help of any kind.


Have you tried freelancing? Check out Scriptlance - I work there.

In reply to User authorization and design of larger web/intranet applications. by techcode

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-05-26 15:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found