Add a method for determining if users can access commerce functions, and
stub out www_view
This commit is contained in:
parent
9284f8744f
commit
14ffef86c1
1 changed files with 35 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue