Empty settings for non-admins

This commit is contained in:
An Phan 2016-08-08 10:55:15 +07:00
parent 470730853d
commit d203b8a9d7
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2

View file

@ -29,7 +29,7 @@ class DataController extends Controller
return response()->json([
'artists' => Artist::orderBy('name')->with('albums', with('albums.songs'))->get(),
'settings' => Setting::lists('value', 'key')->all(),
'settings' => auth()->user()->is_admin ? Setting::lists('value', 'key')->all() : [],
'playlists' => $playlists,
'interactions' => Interaction::byCurrentUser()->get(),
'users' => auth()->user()->is_admin ? User::all() : [],