Code Search for Developers
 
 
  

EditControlRule.pm from AlphaMail at Krugle


Show EditControlRule.pm syntax highlighted

package EditControlRule;

use Apache::SiteControl::Rule;

@ISA = qw(Apache::SiteControl::Rule);

# This rule is going to be used in a system that automatically grants
# permission for everything (via the GrantAllRule). So this rule will
# only worry about what to deny, and the grants method can return whatever.
# Note that writing a deny-based system is inherently more dangerous and 
# buggy because of the lack of type-safety. Typos in the HTML components can
# cause a rule to fail to deny an invalid request, which is typically less
# desirable than failing to grant a request. The former is a security hole that
# might get missed; the latter is a bug that gets quickly reported.
sub grants($$$$)
{
   return 0;
}

sub denies($$$$)
{
   my ($this, $user, $action, $resource) = @_;

   return 1 if($action eq "edit" && $user->getUsername ne "admin");

   return 0;
}

1;




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  site/
    index.html
    logout.html
  site2/
    EditControlRule.pm
    MyPermissionFactory.pm
    README
    StringUserFactory.pm
    apache2.conf
    apache_sitecontrol.conf
    logout.html
    modperl_init.pl
    page.html
    samplelogin.pl
  EditControlRule.pm
  MyPermissionFactory.pm
  README
  SimpleAuth.pm
  apache_modperlinit.pl
  apache_sitecontrol.conf
  index.html
  samplelogin.pl
  schema.psql