From 1b1804fc1646e957b38401468a5a43d25198b416 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 26 Feb 2007 23:13:36 +0000 Subject: [PATCH] fixing Calendar/Event add/edit privileges --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/Event.pm | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 3dcd0cf52..69c439d13 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,8 @@ - fix: Off by 1 error while displaying ad impressions (perlDreamer Consulting, LLC) - fix: Wrong link in template toolkit help (perlDreamer Consulting, LLC) - fix: Outdated info in Env macro help (perlDreamer Consulting, LLC) + - fix: Calendar: Only Turn Admin On group can add events (perlDreamer Consulting, LLC) + - fix: Event -> canEdit (perlDreamer Consulting, LLC) - fix: A bunch of bugs in fileImport.pl and improved its performance very significantly (Martin Kamerbeek / Oqapi) diff --git a/lib/WebGUI/Asset/Event.pm b/lib/WebGUI/Asset/Event.pm index 22619e853..1349a62ce 100644 --- a/lib/WebGUI/Asset/Event.pm +++ b/lib/WebGUI/Asset/Event.pm @@ -131,6 +131,24 @@ sub definition { +#------------------------------------------------------------------- + +=head2 canAdd ( session ) + +Class method to verify that the user has the privileges necessary to add this type of asset. Return a boolean. + +=head3 session + +The session variable. + +=cut + +sub canAdd { + my $class = shift; + my $session = shift; + $class->SUPER::canAdd($session, undef, '7'); +} + #################################################################### @@ -144,7 +162,8 @@ sub canEdit { my $self = shift; my $session = $self->session; - return $session->user->isInGroup($self->getParent->get("groupIdEventEdit")); + return $session->user->isInGroup($self->getParent->get("groupIdEventEdit")) + or $self->SUPER::canEdit; }