in reply to User access controlled by subroutine attribute.

Perl Hacks has an example of that. I used a similar method to add access control to objects accessible through web services. It worked wonderfully.

  • Comment on Re: User access controlled by subroutine attribute.

Replies are listed 'Best First'.
Re^2: User access controlled by subroutine attribute.
by rlb3 (Deacon) on Aug 14, 2006 at 21:39 UTC

    Thanks for replying.

    It's funny, I was listening to your talk on PDX.pm that got me thinking about Attribute::Handler. And I agree that your access control to objects works but I'm having this nagging feeling that using it for user access will have weird problems for users. Like a user getting so far into a program before they get an access denied. That may not be a bad thing. I'm just not sure.

      You could check permissions up front, and check it again at the function level as a failsafe. That way, your users won't normally get "far into a program" before getting an error.

        That is true but then there is no point of making access attached to each sub with an attribute.