GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  APACHE2::SITECONTROL::RULE (3)

.ds Aq ’

NAME

Apache2::SiteControl::Rule - Permission manager access rule.

    DESCRIPTION

Each rule is a custom-written class that implements some aspect of your site’s access logic. Rules can choose to grant or deny a request.



   package sample::Test;

   use strict;
   use warnings;
   use Carp;
   use Apache2::SiteControl::Rule;

   use base qw(Apache2::SiteControl::Rule);

   sub grants($$$$)
   {
      my $this = shift;
      my $user = shift;
      my $action = shift;
      my $resource = shift;

      if($action eq "edit" && $resource->isa("sample::Record")) {
         return 1 if($user{name} eq "root");
      }

      return 0;
   }

   sub denies($$$$)
   {
      return 0;
   }

   1;



The PermissionManager will only give permission if at least one rule grants permission, and no rule denies it.

It is important that your rules never grant or deny a request they do not understand, so it is a good idea to use type checking to prevent strangeness. <B>Assertions should not be usedB> if you expect different rules to accept different resource types or user types, since each rule is used on every access request.

CONTENTS

EXPORT

None by default.

SEE ALSO

Apache2::SiteControl::UserFactory, Apache::SiteControl::ManagerFactory, Apache2::SiteControl::PermissionManager, Apache::SiteControl

AUTHOR

This module was written by Tony Kay, <tkay@uoregon.edu>.

COPYRIGHT AND LICENSE

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 APACHE2::SITECONTROL::RULE (3) 2006-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.