-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Add Auto-Approve Env Vars for Group and Event Creation #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -427,21 +427,8 @@ public function getMaxUpdatedAtDevicesUpdatedAtAttribute() | |
|
|
||
| public function getAutoApproveAttribute() | ||
| { | ||
| // A group's events are auto-approved iff all the networks that the group belongs to are set to auto-approve | ||
| // events. | ||
| $autoapprove = false; | ||
|
|
||
| $networks = $this->networks; | ||
|
|
||
| if ($networks && count($networks)) { | ||
| $autoapprove = true; | ||
|
|
||
| foreach ($networks as $network) { | ||
| $autoapprove &= $network->auto_approve_events; | ||
| } | ||
| } | ||
|
|
||
| return $autoapprove; | ||
| // Events are auto-approved based on environment configuration | ||
| return env('FEATURE__AUTO_APPROVE_EVENTS', false); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole network feature is similar to multiple instances of Restarters. We don't really use the Network feature so having to check the group on all networks would not apply for us. |
||
| } | ||
|
|
||
| public function getDistanceAttribute() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably right, but funky lol. I would have assumed ROOT was a higher level than HOST. But I'm assuming they are just numbers starting with 1 for highest permission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
restarters/app/Models/Role.php
Lines 11 to 16 in 1092162