[freeside-commits] freeside/httemplate/edit/process part_pkg.cgi, 1.37, 1.38
Ivan,,,
ivan at wavetail.420.am
Sat Feb 7 18:05:27 PST 2009
- Previous message: [freeside-commits] freeside/httemplate/edit part_pkg.cgi, 1.101, 1.102 cust_main.cgi, 1.94, 1.95
- Next message: [freeside-commits] freeside/httemplate/elements tr-select-agent_types.html, 1.1, 1.2 select-agent_types.html, 1.1, 1.2 select-cust-part_pkg.html, 1.2, 1.3 select-part_pkg.html, 1.1, 1.2 select-table.html, 1.13, 1.14
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv1782/httemplate/edit/process
Modified Files:
part_pkg.cgi
Log Message:
further work on agents editing own packages: allow them to see (but not edit) global packages for their type, RT#1331
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_pkg.cgi,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- part_pkg.cgi 30 Aug 2008 02:10:09 -0000 1.37
+++ part_pkg.cgi 8 Feb 2009 02:05:25 -0000 1.38
@@ -1,11 +1,12 @@
<% include( 'elements/process.html',
#'debug' => 1,
'table' => 'part_pkg',
+ 'agent_virt' => 1,
+ 'agent_null_right' => \@agent_null_right,
'redirect' => $redirect_callback,
'viewall_dir' => 'browse',
'viewall_ext' => 'cgi',
'edit_ext' => 'cgi',
- #XXX usable with cloning? #'agent_null_right' => 'Edit global package definitions',
'precheck_callback' => $precheck_callback,
'args_callback' => $args_callback,
'process_m2m' => \@process_m2m,
@@ -13,12 +14,21 @@
%>
<%init>
+my $customizing = ( ! $cgi->param('pkgpart') && $cgi->param('pkgnum') );
+
my $curuser = $FS::CurrentUser::CurrentUser;
+my $edit_global = 'Edit global package definitions';
+my $customize = 'Customize customer package';
+
die "access denied"
unless $curuser->access_right('Edit package definitions')
- || $curuser->access_right('Edit global package definitions')
- || ( ! $cgi->param('pkgpart') && $cgi->param('pkgnum') && $curuser->access_right('Customize customer package') );
+ || $curuser->access_right($edit_global)
+ || ( $customizing && $curuser->access_right($customize) );
+
+my @agent_null_right = ( $edit_global );
+push @agent_null_right, $customize if $customizing;
+
my $precheck_callback = sub {
my( $cgi ) = @_;
@@ -41,7 +51,8 @@
unless scalar(@agents)
|| ( $cgi->param('clone') && $cgi->param('clone') =~ /^\d+$/ )
|| ( !$cgi->param('pkgpart') && $conf->exists('agent-defaultpkg') )
- || $cgi->param('disabled');
+ || $cgi->param('disabled')
+ || $cgi->param('agentnum');
return '';
- Previous message: [freeside-commits] freeside/httemplate/edit part_pkg.cgi, 1.101, 1.102 cust_main.cgi, 1.94, 1.95
- Next message: [freeside-commits] freeside/httemplate/elements tr-select-agent_types.html, 1.1, 1.2 select-agent_types.html, 1.1, 1.2 select-cust-part_pkg.html, 1.2, 1.3 select-part_pkg.html, 1.1, 1.2 select-table.html, 1.13, 1.14
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list