Verschiebung von Upgrade-Script
authorNiclas Zimmermann <niclas@kivitendo-premium.de>
Thu, 13 Jun 2013 08:15:47 +0000 (10:15 +0200)
committerNiclas Zimmermann <niclas@kivitendo-premium.de>
Thu, 13 Jun 2013 08:15:47 +0000 (10:15 +0200)
Upgrade-Script für das Setzen von Nutzerrechten befindet sich jetzt
im Ordner Pg-Upgrade2-auth anstatt im Order Pg-Upgrade2.

sql/Pg-upgrade2-auth/productivity_rights.pl [new file with mode: 0644]

diff --git a/sql/Pg-upgrade2-auth/productivity_rights.pl b/sql/Pg-upgrade2-auth/productivity_rights.pl
new file mode 100644 (file)
index 0000000..4dd0270
--- /dev/null
@@ -0,0 +1,27 @@
+# @tag: productivity_rights
+# @description: Setzt das Recht die Produktivität einzusehen und das Recht den Link zum Admin-Menü anzuzeigen wieder wie vorher
+# @depends: release_3_0_0
+package SL::DBUpgrade2::productivity_rights;
+
+use strict;
+use utf8;
+
+use parent qw(SL::DBUpgrade2::Base);
+
+use SL::DBUtils;
+
+sub run {
+  my ($self) = @_;
+
+  my $groups = $main::auth->read_groups();
+
+  foreach my $group (values %{$groups}) {
+    $group->{rights}->{productivity}       = 1 unless defined $group->{rights}->{productivity};
+    $group->{rights}->{display_admin_link} = 1 unless defined $group->{rights}->{display_admin_link};
+    $main::auth->save_group($group);
+  }
+
+  return 1;
+} # end run
+
+1;