Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8b4ff253

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 8b4ff253e3498121df023a65bc502d5e099b15e8
  • Vorgänger 1ae7f9a1
  • Nachfolger 16d62a38

Pflichtenhefte: eigenes Recht einführen

Unterschiede anzeigen:

SL/Auth.pm
1059 1059
    ["part_service_assembly_details",  $locale->text("Show details and reports of parts, services, assemblies")],
1060 1060
    ["project_edit",                   $locale->text("Create and edit projects")],
1061 1061
    ["--ar",                           $locale->text("AR")],
1062
    ["requirement_spec_edit",          $locale->text("Create and edit requirement specs")],
1062 1063
    ["sales_quotation_edit",           $locale->text("Create and edit sales quotations")],
1063 1064
    ["sales_order_edit",               $locale->text("Create and edit sales orders")],
1064 1065
    ["sales_delivery_order_edit",      $locale->text("Create and edit sales delivery orders")],
......
1479 1480
Nothing here yet.
1480 1481

  
1481 1482
=head1 AUTHOR
1482

  
1483
pp
1483 1484
Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
1484 1485

  
1485 1486
=cut
SL/Controller/RequirementSpec.pm
289 289
sub setup {
290 290
  my ($self) = @_;
291 291

  
292
  $::auth->assert('sales_quotation_edit');
292
  $::auth->assert('requirement_spec_edit');
293 293
  $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec);
294 294
  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec ckeditor/ckeditor ckeditor/adapters/jquery);
295 295
  $self->init_visible_section;
SL/Controller/RequirementSpecItem.pm
496 496

  
497 497
sub check_auth {
498 498
  my ($self) = @_;
499
  $::auth->assert('sales_quotation_edit');
499
  $::auth->assert('requirement_spec_edit');
500 500
}
501 501

  
502 502
sub load_requirement_spec_item {
SL/Controller/RequirementSpecOrder.pm
54 54
sub action_create {
55 55
  my ($self)         = @_;
56 56

  
57
  if (!$::auth->assert($::form->{quotation} ? 'sales_quotation_edit' : 'sales_order_edit', 1)) {
58
    return $self->js->flash('error', t8("You do not have the permissions to access this function."))->render($self);
59
  }
60

  
57 61
  # 1. Update sections with selected part IDs.
58 62
  my $section_attrs  = $::form->{sections} || [];
59 63
  my $sections       = SL::DB::Manager::RequirementSpecItem->get_all(where => [ id => [ map { $_->{id} } @{ $section_attrs } ] ]);
......
93 97
  my $order    = $self->rs_order->order;
94 98
  my $sections = $self->requirement_spec->sections_sorted;
95 99

  
100
  if (!$::auth->assert($order->quotation ? 'sales_quotation_edit' : 'sales_order_edit', 1)) {
101
    return $self->js->flash('error', t8("You do not have the permissions to access this function."))->render($self);
102
  }
103

  
96 104
  my (@orderitems, %sections_seen);
97 105
  foreach my $item (@{ $order->items_sorted }) {
98 106
    my $section = first { my $num = $_->fb_number; $item->description =~ m{\b\Q${num}\E\b} && !$sections_seen{ $_->id } } @{ $sections };
......
204 212
sub setup {
205 213
  my ($self) = @_;
206 214

  
207
  $::auth->assert('sales_quotation_edit');
215
  $::auth->assert('requirement_spec_edit');
208 216
  $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec autocomplete_part);
209 217
  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu client_js requirement_spec);
210 218

  
SL/Controller/RequirementSpecTextBlock.pm
26 26
  'scalar --get_set_init' => [ qw(predefined_texts js picture) ],
27 27
);
28 28

  
29
__PACKAGE__->run_before('check_auth');
29 30
__PACKAGE__->run_before('load_requirement_spec_text_block', only => [qw(ajax_edit ajax_update ajax_delete ajax_flag dragged_and_dropped ajax_copy ajax_add_picture)]);
30 31

  
31 32
#
......
398 399
# filters
399 400
#
400 401

  
402
sub check_auth {
403
  my ($self) = @_;
404
  $::auth->assert('requirement_spec_edit');
405
}
406

  
401 407
sub load_requirement_spec_text_block {
402 408
  my ($self) = @_;
403 409
  $self->text_block(SL::DB::RequirementSpecTextBlock->new(id => $::form->{id})->load || die "No such requirement spec text block");
SL/Controller/RequirementSpecVersion.pm
95 95

  
96 96
sub check_auth {
97 97
  my ($self, %params) = @_;
98
  $::auth->assert('sales_quotation_edit');
98
  $::auth->assert('requirement_spec_edit');
99 99
}
100 100

  
101 101
#
locale/de/all
580 580
  'Create and edit projects'    => 'Projekte erfassen und bearbeiten',
581 581
  'Create and edit purchase delivery orders' => 'Lieferscheine von Lieferanten erfassen und bearbeiten',
582 582
  'Create and edit purchase orders' => 'Lieferantenauftr&auml;ge erfassen und bearbeiten',
583
  'Create and edit requirement specs' => 'Pflichtenhefte erstellen und bearbeiten',
583 584
  'Create and edit sales delivery orders' => 'Lieferscheine f&uuml;r Kunden erfassen und bearbeiten',
584 585
  'Create and edit sales orders' => 'Auftragsbest&auml;tigungen erfassen und bearbeiten',
585 586
  'Create and edit sales quotations' => 'Angebote erfassen und bearbeiten',
......
2807 2808
  'You cannot create an invoice for delivery orders for different customers.' => 'Sie können keine Rechnung zu Lieferscheinen für verschiedene Kunden erstellen.',
2808 2809
  'You cannot create an invoice for delivery orders from different vendors.' => 'Sie können keine Rechnung aus Lieferscheinen von verschiedenen Lieferanten erstellen.',
2809 2810
  'You cannot paste function blocks or sub function blocks if there is no section.' => 'Sie können keine Funktionsblöcke oder Unterfunktionsblöcke einfügen, wenn es noch keinen Abschnitt gibt.',
2810
  'You do not have the permissions to access this function.' => 'Sie verf&uuml;gen nicht &uuml;ber die notwendigen Rechte, um auf diese Funktion zuzugreifen.',
2811
  'You do not have the permissions to access this function.' => 'Sie verfügen nicht über die notwendigen Rechte, um auf diese Funktion zuzugreifen.',
2811 2812
  'You have entered or selected the following shipping address for this customer:' => 'Sie haben die folgende Lieferadresse eingegeben oder ausgew&auml;hlt:',
2812 2813
  'You have never worked with currencies.' => 'Sie haben noch nie  mit Währungen gearbeitet.',
2813 2814
  'You have not added bank accounts yet.' => 'Sie haben noch keine Bankkonten angelegt.',
menus/erp.ini
36 36
action=Project/new
37 37

  
38 38
[Master Data--Add Requirement Spec Template]
39
ACCESS=project_edit
39
ACCESS=requirement_spec_edit
40 40
module=controller.pl
41 41
action=RequirementSpec/new
42 42
is_template=1
......
96 96
filter.valid=valid
97 97

  
98 98
[Master Data--Reports--Requirement Spec Templates]
99
ACCESS=requirement_spec_edit
99 100
module=controller.pl
100 101
action=RequirementSpec/list
101 102
is_template=1
......
103 104
[AR]
104 105

  
105 106
[AR--Add Requirement Spec]
107
ACCESS=requirement_spec_edit
106 108
module=controller.pl
107 109
action=RequirementSpec/new
108 110

  
......
147 149
submenu=1
148 150

  
149 151
[AR--Reports--Requirement Specs]
152
ACCESS=requirement_spec_edit
150 153
module=controller.pl
151 154
action=RequirementSpec/list
152 155

  
sql/Pg-upgrade2-auth/requirement_spec_rights.pl
1
# @tag: requirement_spec_rights
2
# @description: Neues Gruppenrecht für Pflichtenhefte
3
# @depends: release_3_0_0
4
package SL::DBUpgrade2::requirement_spec_rights;
5

  
6
use strict;
7
use utf8;
8

  
9
use parent qw(SL::DBUpgrade2::Base);
10

  
11
use SL::DBUtils;
12

  
13
sub run {
14
  my ($self) = @_;
15

  
16
  my $groups = $::auth->read_groups;
17

  
18
  foreach my $group (values %{$groups}) {
19
    $group->{rights}->{requirement_spec_edit} = $group->{rights}->{sales_quotation_edit} ? 1 : 0;
20
    $::auth->save_group($group);
21
  }
22

  
23
  return 1;
24
}
25

  
26
1;

Auch abrufbar als: Unified diff