From: Martin Helmling martin.helmling@octosoft.eu Date: Fri, 30 Sep 2016 17:40:13 +0000 (+0200) Subject: Verteilen der Rechte für Finanzbuchhaltung auf Dialogbuchung,Kreditoren-/Debitorenrec... X-Git-Tag: release-3.5.4~2004 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e0f5deeae4cdcf3faf3bc68a202f20ec6cd9af2e;p=kivitendo-erp.git Verteilen der Rechte für Finanzbuchhaltung auf Dialogbuchung,Kreditoren-/Debitorenrechnungen Es werden drei neue Rechte eingeführt, die den Zugriff auf Dialogbuchungen,Kreditoren-/Debitorenrechnungen verfeinern Das Recht für Finanzbuchhaltung wird auf diese Rechte als default kopiert --- diff --git a/SL/Auth.pm b/SL/Auth.pm index 5d0b3c871..e8d6c72e1 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -936,7 +936,7 @@ sub all_rights_full { my ($self) = @_; @{ $self->{master_rights} ||= do { - $self->dbconnect->selectall_arrayref("SELECT name, description, category FROM auth.master_rights ORDER BY id"); + $self->dbconnect->selectall_arrayref("SELECT name, description, category FROM auth.master_rights ORDER BY position"); } } } diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index b2e32e6fa..d12fc6edf 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -263,7 +263,8 @@ sub action_save_and_close { sub _transaction { my ($self, $script) = @_; - $::auth->assert('general_ledger | invoice_edit | vendor_invoice_edit | ' . + $::auth->assert('gl_transactions | ap_transactions | ar_transactions'. + '| invoice_edit | vendor_invoice_edit | ' . ' request_quotation_edit | sales_quotation_edit | sales_order_edit | purchase_order_edit'); $self->_save(); @@ -287,7 +288,7 @@ sub _transaction { sub action_save_and_ar_transaction { my ($self) = @_; - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); $self->_transaction('ar.pl'); } @@ -295,7 +296,7 @@ sub action_save_and_ar_transaction { sub action_save_and_ap_transaction { my ($self) = @_; - $main::auth->assert('general_ledger'); + $main::auth->assert('ap_transactions'); $self->_transaction('ap.pl'); } diff --git a/SL/Controller/Draft.pm b/SL/Controller/Draft.pm index 3f03f2c67..41c8c1688 100644 --- a/SL/Controller/Draft.pm +++ b/SL/Controller/Draft.pm @@ -164,7 +164,7 @@ sub init_draft { } sub check_auth { - $::auth->assert('vendor_invoice_edit | invoice_edit | general_ledger'); + $::auth->assert('vendor_invoice_edit | invoice_edit | ap_transactions | ar_transactions'); } 1; diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 1b59d789e..6c4dcb8b4 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -81,7 +81,7 @@ use strict; sub add { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -108,7 +108,7 @@ sub add { sub edit { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; @@ -127,7 +127,7 @@ sub edit { sub display_form { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; @@ -146,7 +146,7 @@ sub _retrieve_invoice_object { sub create_links { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my %params = @_; my $form = $main::form; @@ -216,7 +216,7 @@ sub create_links { sub form_header { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -476,7 +476,7 @@ sub form_header { sub form_footer { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -513,7 +513,7 @@ sub form_footer { sub mark_as_paid { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -526,7 +526,7 @@ sub mark_as_paid { sub update { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -616,7 +616,7 @@ sub update { sub post_payment { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -666,7 +666,7 @@ sub post_payment { sub _post { - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; @@ -677,7 +677,7 @@ sub _post { sub post { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -767,7 +767,7 @@ sub post { sub post_as_new { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -789,7 +789,7 @@ sub post_as_new { sub use_as_new { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -806,7 +806,7 @@ sub use_as_new { sub delete { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my $locale = $main::locale; @@ -845,7 +845,7 @@ sub delete { sub yes { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -1187,7 +1187,7 @@ sub ar_transactions { sub storno { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index 29cad3977..f90097032 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -53,7 +53,7 @@ sub check_name { my %myconfig = %main::myconfig; my $locale = $main::locale; - $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $main::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash |' . 'purchase_delivery_order_edit | sales_delivery_order_edit'); @@ -152,7 +152,7 @@ sub select_name { my $form = $main::form; my $locale = $main::locale; - $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit | sales_delivery_order_edit |' . + $main::auth->assert('ar_transactions| ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit | sales_delivery_order_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash'); my ($table) = @_; @@ -260,7 +260,7 @@ sub name_selected { my $form = $main::form; my %myconfig = %main::myconfig; - $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit | sales_delivery_order_edit | ' . + $main::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit | sales_delivery_order_edit | ' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash'); # replace the variable with the one checked @@ -302,7 +302,7 @@ sub _reset_salesman_id { sub select_project { $::lxdebug->enter_sub; - $::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); my ($is_global, $nextsub) = @_; @@ -329,7 +329,7 @@ sub project_selected { my $form = $main::form; - $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $main::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); # replace the variable with the one checked diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index ea94a28be..42ac4a008 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -78,7 +78,7 @@ require "bin/mozilla/reportgenerator.pl"; sub add { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -118,7 +118,7 @@ sub add { sub prepare_transaction { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -189,7 +189,7 @@ sub prepare_transaction { sub edit { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -210,7 +210,7 @@ sub edit { sub search { $::lxdebug->enter_sub; - $::auth->assert('general_ledger'); + $::auth->assert('gl_transactions'); $::form->all_departments(\%::myconfig); $::form->get_lists( @@ -249,7 +249,7 @@ sub create_subtotal_row { sub generate_report { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -513,7 +513,7 @@ sub generate_report { sub update { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -621,7 +621,7 @@ sub display_form { my ($init) = @_; $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -644,7 +644,7 @@ sub display_rows { my ($init) = @_; $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -848,7 +848,7 @@ sub _get_radieren { sub form_header { $::lxdebug->enter_sub; - $::auth->assert('general_ledger'); + $::auth->assert('gl_transactions'); my ($init) = @_; @@ -896,7 +896,7 @@ sub form_header { sub form_footer { $::lxdebug->enter_sub; - $::auth->assert('general_ledger'); + $::auth->assert('gl_transactions'); my ($follow_ups, $follow_ups_due); @@ -1147,7 +1147,7 @@ sub post_transaction { sub post { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my $locale = $main::locale; @@ -1172,7 +1172,7 @@ sub post { sub post_as_new { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; @@ -1185,7 +1185,7 @@ sub post_as_new { sub storno { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('gl_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 96a425d8c..0a1a35227 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -102,8 +102,8 @@ use strict; my $rp_access_map = { 'projects' => 'report', - 'ar_aging' => 'general_ledger', - 'ap_aging' => 'general_ledger', + 'ar_aging' => 'general_ledger | ar_transactions', + 'ap_aging' => 'general_ledger | ap_transactions', 'receipts' => 'cash', 'payments' => 'cash', 'trial_balance' => 'report', @@ -928,7 +928,7 @@ sub list_accounts { sub generate_ar_aging { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('general_ledger | ar_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -951,7 +951,7 @@ sub generate_ar_aging { sub generate_ap_aging { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger'); + $main::auth->assert('general_ledger | ap_transactions'); my $form = $main::form; my %myconfig = %main::myconfig; diff --git a/bin/mozilla/vk.pl b/bin/mozilla/vk.pl index 7441c3886..6c10f4d01 100644 --- a/bin/mozilla/vk.pl +++ b/bin/mozilla/vk.pl @@ -48,7 +48,7 @@ use strict; sub search_invoice { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger | invoice_edit'); + $main::auth->assert('ar_transactions | ap_transactions | invoice_edit'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -92,7 +92,7 @@ sub search_invoice { sub invoice_transactions { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger | invoice_edit'); + $main::auth->assert('ar_transactions | ap_transactions | invoice_edit'); my $form = $main::form; my %myconfig = %main::myconfig; diff --git a/doc/changelog b/doc/changelog index 57d85e45e..9bf0a7c8b 100644 --- a/doc/changelog +++ b/doc/changelog @@ -6,6 +6,9 @@ kleinere neue Features und Detailverbesserungen: + - Verfeinerung der Rechte für Finanzbuchhaltung: Es können nun für Dialogbuchungen, + Debitoren- und Kreditorenbuchungen extra Rechte vergeben werden + - Weiterer Bericht in der Rubrik Lager: Lagerentnahme Gibt eine Statistik über Lagerbewegungen, pro Monat/Quartal/Jahr. diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index b981290bf..96250db20 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -564,7 +564,7 @@ name: Add Transaction icon: transaction_add order: 100 - access: general_ledger + access: gl_transactions module: gl.pl params: action: add @@ -573,7 +573,7 @@ name: Add AR Transaction icon: ar_transaction_add order: 200 - access: general_ledger + access: ar_transactions module: ar.pl params: action: add @@ -582,7 +582,7 @@ name: Add AP Transaction icon: ap_transaction_add order: 300 - access: general_ledger + access: ap_transactions module: ap.pl params: action: add diff --git a/sql/Pg-upgrade2-auth/split_transaction_rights.pl b/sql/Pg-upgrade2-auth/split_transaction_rights.pl new file mode 100644 index 000000000..d6e829fd8 --- /dev/null +++ b/sql/Pg-upgrade2-auth/split_transaction_rights.pl @@ -0,0 +1,40 @@ +# @tag: split_transaction_rights +# @description: Finanzbuchhaltungsrechte für Buchungen aufspalten +# @depends: release_3_4_0 master_rights_position_gaps +# @charset: utf-8 +# @locales: General Ledger Transaction +# @locales: AR Transactions +# @locales: AP Transactions + + +package SL::DBUpgrade2::split_transaction_rights; + +use strict; +use utf8; + +use parent qw(SL::DBUpgrade2::Base); + +use SL::DBUtils; + +sub run { + my ($self) = @_; + + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES (3130,'gl_transactions','General Ledger Transaction')"); + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES (3150,'ar_transactions','AR Transactions')"); + $self->db_query("INSERT INTO auth.master_rights (position, name, description) VALUES (3170,'ap_transactions','AP Transactions')"); + $self->db_query("UPDATE auth.master_rights SET description='General Ledger' WHERE name='general_ledger'"); + + my $groups = $main::auth->read_groups(); + + foreach my $group (values %{$groups}) { + $group->{rights}->{gl_transactions} = $group->{rights}->{general_ledger}; + $group->{rights}->{ar_transactions} = $group->{rights}->{general_ledger}; + $group->{rights}->{ap_transactions} = $group->{rights}->{general_ledger}; + $main::auth->save_group($group); + } + + return 1; +} # end run + +1; +