sub draft_list {
my ($self) = @_;
- my $result = selectall_hashref_query($::form, $::form->get_standard_dbh, <<SQL, $self->module, $self->submodule, SL::DB::Manager::Employee->current->id);
+ if ($::auth->assert('all_drafts_edit', 1)) {
+ my $result = selectall_hashref_query($::form, $::form->get_standard_dbh, <<SQL, $self->module, $self->submodule);
+ SELECT d.*, date(d.itime) AS date
+ FROM drafts d
+ WHERE (d.module = ?)
+ AND (d.submodule = ?)
+ ORDER BY d.itime
+SQL
+ } else {
+ my $result = selectall_hashref_query($::form, $::form->get_standard_dbh, <<SQL, $self->module, $self->submodule, SL::DB::Manager::Employee->current->id);
SELECT d.*, date(d.itime) AS date
FROM drafts d
WHERE (d.module = ?)
AND (d.employee_id = ?)
ORDER BY d.itime
SQL
+ }
}
sub dialog_html {
'Edit Warehouse' => 'Lager bearbeiten',
'Edit acceptance status' => 'Abnahmestatus bearbeiten',
'Edit additional articles' => 'Zusätzliche Artikel bearbeiten',
+ 'Edit all drafts' => 'Entwürfe von allen Benutzern bearbeiten',
'Edit article/section assignments' => 'Zuweisung Artikel/Abschnitte bearbeiten',
'Edit assignment of articles to sections' => 'Zuweisung Artikel zu Abschnitten bearbeiten',
'Edit background job' => 'Hintergrund-Job bearbeiten',
--- /dev/null
+# @tag: all_drafts_edit
+# @description: Zugriffsrecht auf alle Entwürfe
+# @depends: release_3_4_0
+# @locales: Edit all drafts
+# @ignore: 0
+package SL::DBUpgrade2::Auth::all_drafts_edit;
+
+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 (?, ?, ?)", bind => $_) for
+ [ 5000, 'all_drafts_edit', 'Edit all drafts' ];
+
+ my $groups = $main::auth->read_groups();
+
+ foreach my $group (values %{$groups}) {
+ $group->{rights}->{all_drafts_edit} = $group->{rights}->{email_employee_readall};
+ $main::auth->save_group($group);
+ }
+
+ return 1;
+} # end run
+
+1;