Add a method for determining if users can access commerce functions, and

stub out www_view
This commit is contained in:
Colin Kuskie 2008-03-07 04:39:17 +00:00
parent 9284f8744f
commit 14ffef86c1

View file

@ -139,6 +139,25 @@ sub calculate {
#-------------------------------------------------------------------
=head2 canEdit ( [ $user ] )
Determine whether or not the current user can perform commerce functions
=head3 $user
An optional WebGUI::User object to check for permission to do commerce functions. If
this is not used, it uses the current session user object.
=cut
sub canEdit {
my $self = shift;
my $user = shift || $session->user;
return $user->isInGroup( $self->session->get('groupIdAdminCommerce'));
}
#-------------------------------------------------------------------
=head2 delete ( [$params] )
Deletes data from the tax table by taxId.
@ -321,4 +340,20 @@ Accessor for the session object. Returns the session object.
=cut
#-------------------------------------------------------------------
=head2 www_view ( )
User interface to manage taxes. Provides a list of current taxes, and forms for adding
new tax info, exporting and importing sets of taxes, and deleting individual tax data.
=cut
sub www_view {
my $self = shift;
return $self->session->privileges->insufficient
unless $self->canEdit;
return '';
}
1;