On 2005-06-30, Steve Comrie <suppressed> wrote:
>
> So off I ran to start coding my Plugin "RMAuth", here it is with a quick
> explanation, caveats and a couple things I'd like to do with it, any
> comments, suggestions and criticisims are greatly appreciated.
Here's some initial feedback, along with a simple patch below that might get
clobbered by e-mail wrapping.
I would include rm_denied() in the plugin, as well as hooking
this into setup:
$self->run_modes( 'rm_denied' => 'rm_denied' );
If people want a different "denied" run mode, they can load the plugin
in a super class and sub-class it, but a sensible default would be nice.
I suggest having the config variables be in a Perl data structure
format. People who want to use XML or any other format can convert it
to Perl.
Also, provide some defaults so this can be skipped:
# init rm authorization
$self->rmauth_init
(
PERMISSIONS => $self->cfg('RM_PERMISSIONS'),
UNAUTH_RUNMODE => 'denied',
);
Mark
--- RMAuth.pm.orig 2005-06-30 22:58:23.682825312 -0500
+++ RMAuth.pm 2005-06-30 23:01:20.462950648 -0500
@@ -14,7 +14,10 @@
$VERSION = '0.01';
-# rmauth init
+=head2 rmauth_init()
+
+=cut
+
sub rmauth_init
{
my $self = shift;
@@ -71,7 +74,6 @@
$self->{__CAP__RMAUTH_CONFIG};
}
-
# does the actual testing of permit vs. module:runmode from prerun callback
sub __cap_rmauth_test_access
{
@@ -89,10 +91,15 @@
}
}
+=head2 rmauth_this_permit()
+
+This function will return a simple hash that contains the permit for this
+module this could be useful for including as a param() sent to an
+Html::Template file, which in turn could contain <tmpl_if
+name='rmauth.edit'>Show Edit Button</tmpl_if> style mark-up
+
+=cut
-# this function will return a simple hash that contains the permit for this module
-# this could be useful for including as a param() sent to an html::template file, which in turn
-# could contain <tmpl_if name='rmauth.edit'>Show Edit Button</tmpl_if> style mark-up
sub rmauth_this_permit
{
my $self = shift;
@@ -112,10 +119,17 @@
return $permit;
}
-# this function will return a simple hash that contains the permit for the entire permissions file
-# this could be useful for including as a param() sent to an html::template file, which in turn
-# could contain <tmpl_if name='rmauth.MyProject.Authors.browse'>Show Author Browse Link</tmpl_if> style mark-up
-# it's worth noting that this hash starts with rmauth_this_permit as it's default hash.
+=head2 rmauth_full_permit()
+
+This function will return a simple hash that contains the permit for the entire
+permissions file this could be useful for including as a param() sent to an
+Html::Template file, which in turn could contain <tmpl_if
+name='rmauth.MyProject.Authors.browse'>Show Author Browse Link</tmpl_if> style
+mark-up it's worth noting that this hash starts with rmauth_this_permit as it's
+default hash.
+
+=cut
+
sub rmauth_full_permit
{
my $self = shift;
@@ -139,8 +153,12 @@
return $permit;
}
+=head2 rmauth_last_denial()
+
+return the name of the run-mode that was last denied by RMAuth
+
+=cut
-# return the name of the run-mode that was last denied by RMAuth
sub rmauth_last_denial
{
my $self = shift;
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.