use IO::Dir;
use List::Util qw(first);
+use List::UtilsBy qw(sort_by);
use SL::Common ();
use SL::DB::AuthUser;
my (@sections, $current_section);
foreach my $entry ($::auth->all_rights_full) {
- if ($entry->[0] =~ m/^--/) {
- push @sections, { description => $entry->[1], rights => [] };
+ if ($entry->[2]) {
+ push @sections, { description => t8($entry->[1]), rights => [] };
} elsif (@sections) {
push @{ $sections[-1]->{rights} }, {
name => $entry->[0],
- description => $entry->[1],
+ description => t8($entry->[1]),
};
} else {
return undef;
}
+sub is_user_used_for_task_server {
+ my ($self, $user) = @_;
+
+ return undef if !$user;
+ return join ', ', sort_by { lc } map { $_->name } @{ SL::DB::Manager::AuthClient->get_all(where => [ task_server_user_id => $user->id ]) };
+}
+
+
1;