Add new ACL option to limit use of environment variables

This commit is contained in:
Jamie Cameron
2026-10-10 10:23:06 -07:00
parent 1a88fcdb74
commit 17ba87cbc6
6 changed files with 11 additions and 0 deletions

View File

@@ -48,6 +48,10 @@ print &ui_table_row($text{'acl_move'},
&ui_radio("move", $_[0]->{'move'},
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]));
print &ui_table_row($text{'acl_env'},
&ui_radio("env", $_[0]->{'env'},
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]));
print &ui_table_row($text{'acl_kill'},
&ui_radio("kill", $_[0]->{'kill'},
[ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]));
@@ -79,6 +83,7 @@ $_[0]->{'command'} = $in{'command'};
$_[0]->{'create'} = $in{'create'};
$_[0]->{'delete'} = $in{'delete'};
$_[0]->{'move'} = $in{'move'};
$_[0]->{'env'} = $in{'env'};
$_[0]->{'kill'} = $in{'kill'};
$_[0]->{'hourly'} = $in{'hourly'};
$_[0]->{'stop'} = $in{'stop'};

View File

@@ -6,6 +6,7 @@ command=1
create=1
delete=1
move=1
env=1
kill=1
hourly=2
stop=1

View File

@@ -4,6 +4,7 @@
require './cron-lib.pl';
&ReadParse();
$access{'env'} || &error($text{'env_ecannot'});
if (!$in{'new'}) {
@jobs = &list_cron_jobs();

View File

@@ -115,6 +115,7 @@ env_where2=Move environment variable
env_top=Before all Cron jobs for user
env_bot=After all Cron jobs
env_leave=Current position
env_ecannot=You are not allowed to edit environment variables
exec_title=Execute Cron Job
exec_ecannot=You are not allowed to execute cron jobs for this user
@@ -134,6 +135,7 @@ acl_gid=Users with primary group
acl_create=Can create Cron jobs?
acl_delete=Can delete Cron jobs?
acl_move=Can move Cron jobs?
acl_env=Can edit environment variables?
acl_kill=Can terminate Cron jobs?
acl_hourly=Limit jobs to at most hourly?
acl_hourlydef=As set in Module Config

View File

@@ -4,5 +4,6 @@ command=1
create=1
delete=1
move=1
env=0
kill=1
hourly=0

View File

@@ -5,6 +5,7 @@
require './cron-lib.pl';
&error_setup($text{'env_err'});
&ReadParse();
$access{'env'} || &error($text{'env_ecannot'});
@jobs = &list_cron_jobs();
if ($in{'new'}) {