Sorry to go off topic and talk about Perl briefly but I need some
opinions about something I had an idea about when going home pissed last
night and I'm still too hungover to decide whether I'm crack fuelled or
not.

Basically I want to be able to do something like ...

        use Sub::ACL;
        use Another::Module.

        my $acl = get_acl_from_somewhere(); 
        # like a database or a flat file
        # it would be of the form 
        # userid : function

        my $userid = get_current_userid();
        # could be from anywhere

        ACL::init($userid, $acl);

        my $am = new AnotherModule();

        # do_something has an entry next to this userid 
        # in the acl we passed and so works normally
        $am->do_something(); 

        #do_somethingelse howvere doesn't and so returns undef
        $am->do_soemthingelse();

        #this will work too
        another_thing($stuff);

basically it automagically intercepts subroutine calls and checks to see
if the current user has permissions for the subroutine and returns undef
if you don't have access to it.  You could also extend it to variables.

Reply via email to