[wellwell-devel] [wellwell/zoom] Add check for permissions to [zoom].

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Mon Aug 16 06:31:00 UTC 2010


commit 5f7eeafbbe6cf851b98195f47e033fefbba5831e
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Mon Aug 16 08:30:37 2010 +0200

    Add check for permissions to [zoom].

 lib/WellWell/Zoom.pm |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/lib/WellWell/Zoom.pm b/lib/WellWell/Zoom.pm
index b6a4408..98777b6 100644
--- a/lib/WellWell/Zoom.pm
+++ b/lib/WellWell/Zoom.pm
@@ -170,6 +170,14 @@ sub parse_handler {
 	if (defined $class && exists $sref->{specs}->{class}->{$class}) {
 		$sob = $sref->{specs}->{class}->{$class};
 		$name = $sob->{name} || $class;
+
+		if ($sob->{permission}) {
+			unless (Vend::Tags->acl('check', $sob->{permission})) {
+				# no permission for this document part
+				$elt->cut();
+				return;
+			}
+		}
 		
 		if ($sob->{type} eq 'list') {
 			$sob->{elts} = [$elt];



More information about the wellwell-devel mailing list