#1: SEARCH IS ALIVE. LET'S GO, YES!

This commit is contained in:
Peter Deltchev 2016-01-20 19:18:18 -08:00
parent 7a005bcf6b
commit 4585eb712e
4 changed files with 2 additions and 9 deletions

View file

@ -40,7 +40,6 @@ class TracksController extends ApiControllerBase
{
session_write_close();
return $this->execute(new UploadTrackCommand(true));
}

View file

@ -82,7 +82,7 @@ Route::group(['prefix' => 'api/v1', 'middleware' => 'json-exceptions'], function
Route::group(['prefix' => 'api/web'], function() {
Route::get('/taxonomies/all', 'Api\Web\TaxonomiesController@getAll');
Route::get('/search', ['middleware' => ['auth', 'can:access-search'], 'uses' => 'Api\Web\SearchController@getSearch']);
Route::get('/search', 'Api\Web\SearchController@getSearch');
Route::get('/tracks', 'Api\Web\TracksController@getIndex');
Route::get('/tracks/{id}', 'Api\Web\TracksController@getShow')->where('id', '\d+');

View file

@ -48,10 +48,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot(GateContract $gate)
{
$gate->define('access-search', function(User $user) {
return $user->hasRole('admin') || $user->hasRole('moderator');
});
$gate->define('access-admin-area', function(User $user) {
return $user->hasRole('admin');
});

View file

@ -66,9 +66,7 @@
<div class="site-body">
<ul class="sidebar" ng-controller="sidebar">
@can('access-search')
<li><pfm-search></pfm-search></li>
@endcan
<li><pfm-search></pfm-search></li>
<li ng-class="{selected: stateIncludes('content.tracks') || stateIncludes('content.track')}"><a href="/tracks">Tracks</a></li>
<li ng-class="{selected: stateIncludes('content.albums') || stateIncludes('content.album')}"><a href="/albums">Albums</a></li>
<li ng-class="{selected: stateIncludes('content.playlists') || stateIncludes('content.playlist')}"><a href="/playlists">Playlists</a></li>