[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. cff659daa935f9bf2641f13c08eb63c25c1d41b8

Stefan Hornburg racke at rt.icdevgroup.org
Tue Apr 7 08:48:49 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  cff659daa935f9bf2641f13c08eb63c25c1d41b8 (commit)
       via  5f9c09e9e3b0b8845ab8a2ba79ef8ff2fbba829f (commit)
      from  61bf84059ae1efc772cb8d21847f8405691e8d9a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cff659daa935f9bf2641f13c08eb63c25c1d41b8
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Tue Apr 7 10:48:36 2009 +0200

    acl parameter added

commit 5f9c09e9e3b0b8845ab8a2ba79ef8ff2fbba829f
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Tue Apr 7 09:40:33 2009 +0200

    order by name

-----------------------------------------------------------------------

Summary of changes and diff:
 README                              |   14 ++++++++++++++
 code/compose.tag                    |   15 ++++++++++++++-
 plugins/wishlists/code/wishlist.tag |    2 +-
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 258c4fd..68d2708 100755
--- a/README
+++ b/README
@@ -96,6 +96,20 @@ empty.
 Please note that [acl check] without a permission is always
 successful.
 
+Acl parameter in [compose]
+..........................
+
+Permissions can be checked for a complete page like that:
+
+[compose
+	acl.check="view_titles"
+	acl.bounce="index"
+    components.body="title_info"
+] 
+
+Please note that submitted [form] forms bypass this permission
+check because they are evaluated during autoload.
+
 Automatic components/attributes
 *******************************
 
diff --git a/code/compose.tag b/code/compose.tag
index ed14932..3009b13 100644
--- a/code/compose.tag
+++ b/code/compose.tag
@@ -16,7 +16,20 @@ sub dots2hash {
 
 sub {
 	my ($template, $opt, $body) = @_;
-	my (%forms, $template_file);
+	my (%acl, %forms, $template_file);
+
+	if ($opt->{acl})  {
+		# check permissions first
+		for my $k (keys %{$opt->{acl}}) {
+			dots2hash(\%acl, $opt->{acl}->{$k}, split /\./, $k);
+		}
+
+		unless ($Tag->acl('check', $acl{check})) {
+			$Tag->deliver({location => $Tag->area($acl{bounce}),
+				status => '302 move temporarily'});
+			return;							
+		}
+	}
 
 	if ($opt->{forms}) {
 		# process forms first
diff --git a/plugins/wishlists/code/wishlist.tag b/plugins/wishlists/code/wishlist.tag
index 989efc6..29c946e 100644
--- a/plugins/wishlists/code/wishlist.tag
+++ b/plugins/wishlists/code/wishlist.tag
@@ -18,7 +18,7 @@ sub {
 	if ($function eq 'carts') {
 		my @carts;
 
-		$set = $Db{carts}->query(qq{select code from carts where uid = $Session->{username}}); 
+		$set = $Db{carts}->query(qq{select code from carts where uid = $Session->{username} order by name}); 
 		@carts = map {$_->[0]} @$set;
 
 		return wantarray ? @carts : join(',', @carts);


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list