Skip to content

Commit

Permalink
Fixing contact groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mickenordin committed Aug 19, 2016
1 parent 1c209c7 commit e9cf1ec
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/Thruk/Controller/api_conf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ sub index {

my ( $c ) = @_;

# Limit access to authorized personell only
return unless Thruk::Action::AddDefaults::add_defaults($c, Thruk::ADD_SAFE_DEFAULTS);
if( !$c->check_user_roles("authorized_for_configuration_information") || !$c->check_user_roles("authorized_for_system_commands")) {
return $c->detach('/error/index/8');
}

# This is Configuration options used by Thruk
$c->stash->{'readonly'} = 0;
$c->stash->{'title'} = 'Configuration Editor';
Expand All @@ -839,14 +845,7 @@ sub index {
$confdir = dirname($c->stash->{usercontent_folder});
}
$c->stash->{'confdir'} = $confdir;

# Limit access to authorized personell only
if( !$c->check_user_roles("authorized_for_configuration_information")
|| !$c->check_user_roles("authorized_for_system_commands")) {
$c->stash->{body} = "<h1>You are not authorized to access this page!</h1>";
} else {
$c->stash->{body} = body $c;
}
$c->stash->{body} = body $c;
}

=head1 LICENSE
Expand Down

0 comments on commit e9cf1ec

Please sign in to comment.