maelstrom-cms/odin

Enable "Global" user visibility?

Closed this issue · 2 comments

Is there a way to enable "global" visibility of checks between users?
A website check created by User A is not visible to User B.

Hi,

This to me sounds a bit like "Teams" functionality.

But you could try removing the scoping here: https://github.com/maelstrom-cms/odin/blob/master/app/Website.php#L48

So it applies a "where" on user_id, you could try removing that and seeing what happens.

I'm going to close this ticket as it's not a bug just a request :)

yup! Thanks!

For any future onlookers:

diff --git a/app/Website.php b/app/Website.php
index 93a86ad..7a18692 100644
--- a/app/Website.php
+++ b/app/Website.php
@@ -45,9 +45,7 @@ class Website extends Model
             if ($request->filled('key')) {
                 $builder->where('cron_key', $request->input('key'));
             } elseif (!app()->runningInConsole()) {
-                if (auth()->check()) {
-                    $builder->where('user_id', auth()->id());
-                } else {
+                if (!auth()->check()) {
                     $builder->where('user_id', '-1');
                 }
             }