summaryrefslogtreecommitdiff
path: root/httemplate/edit/part_pkg.cgi
diff options
context:
space:
mode:
authorivan <ivan>2008-01-17 04:23:14 +0000
committerivan <ivan>2008-01-17 04:23:14 +0000
commitedb7652d50dcbabc4ec066a78ae8f65a4a7b5d24 (patch)
tree8749a7f45b4cfa74e149ab0fdeb5c1b11aaa1288 /httemplate/edit/part_pkg.cgi
parent911ceed14633190dc705b931d83db12a6f3d233d (diff)
fix ACLs to allow the limited "package editing" of customizing customer packages
Diffstat (limited to 'httemplate/edit/part_pkg.cgi')
-rwxr-xr-xhttemplate/edit/part_pkg.cgi12
1 files changed, 8 insertions, 4 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 7e7944871..ec001cb0c 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -243,6 +243,7 @@ Line-item revenue recognition
% delete $freq{$_} foreach grep { ! /^\d+$/ } keys %freq;
%}
%
+%#this should be replaced by /elements/selectlayers.html
%my $widget = new HTML::Widgets::SelectLayers(
% 'selected_layer' => $part_pkg->plan,
% 'options' => \%options,
@@ -363,10 +364,6 @@ Line-item revenue recognition
<% include('/elements/footer.html') %>
<%init>
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Edit package definitions')
- || $FS::CurrentUser::CurrentUser->access_right('Edit global package definitions');
-
if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
$cgi->param('clone', $1);
} else {
@@ -378,6 +375,13 @@ if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
$cgi->param('pkgnum', '');
}
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('Edit package definitions')
+ || $curuser->access_right('Edit global package definitions')
+ || ( $cgi->param('pkgnum') && $curuser->access_right('Customize customer package') );
+
my ($query) = $cgi->keywords;
my $conf = new FS::Conf;