config options supporters can promote
This commit is contained in:
parent
496d75b9ef
commit
76c37a5f18
|
@ -262,6 +262,9 @@ return [
|
|||
// Whether newly-registered user should automatically be marked as arrived
|
||||
'autoarrive' => (bool) env('ANGEL_AUTOARRIVE', false),
|
||||
|
||||
// Supporters of an angeltype can promote other angels of the angeltype to supporter
|
||||
'supporters_can_promote' => (bool) env('SUPPORTERS_CAN_PROMOTE', false),
|
||||
|
||||
// Only allow shift signup this number of hours in advance
|
||||
// Setting this to 0 disables the feature
|
||||
'signup_advance_hours' => env('SIGNUP_ADVANCE_HOURS', 0),
|
||||
|
|
|
@ -265,7 +265,7 @@ function user_angeltype_update_controller(): array
|
|||
$supporter = false;
|
||||
$request = request();
|
||||
|
||||
if (!auth()->can('admin_angel_types')) {
|
||||
if (!auth()->can('admin_angel_types') && !config('supporters_can_promote')) {
|
||||
error(__('You are not allowed to set supporter rights.'));
|
||||
throw_redirect(url('/angeltypes'));
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
]);
|
||||
$members_unconfirmed[] = $member;
|
||||
} elseif ($member->pivot->supporter) {
|
||||
if ($admin_angeltypes) {
|
||||
if ($admin_angeltypes || ($admin_user_angeltypes && config('supporters_can_promote'))) {
|
||||
$member['actions'] = table_buttons([
|
||||
button(
|
||||
url('/user-angeltypes', [
|
||||
|
@ -342,7 +342,7 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange
|
|||
} else {
|
||||
if ($admin_user_angeltypes) {
|
||||
$member['actions'] = table_buttons([
|
||||
$admin_angeltypes ?
|
||||
($admin_angeltypes || config('supporters_can_promote')) ?
|
||||
button(
|
||||
url('/user-angeltypes', [
|
||||
'action' => 'update',
|
||||
|
|
Loading…
Reference in New Issue