mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
#1: Darklaunched search to site staff.
This commit is contained in:
parent
e295c41243
commit
33befbe3d0
3 changed files with 8 additions and 2 deletions
|
@ -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', 'Api\Web\SearchController@getSearch');
|
||||
Route::get('/search', ['middleware' => ['auth', 'can:access-search'], 'Api\Web\SearchController@getSearch']);
|
||||
|
||||
Route::get('/tracks', 'Api\Web\TracksController@getIndex');
|
||||
Route::get('/tracks/{id}', 'Api\Web\TracksController@getShow')->where('id', '\d+');
|
||||
|
|
|
@ -48,6 +48,10 @@ 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');
|
||||
});
|
||||
|
|
|
@ -66,7 +66,9 @@
|
|||
|
||||
<div class="site-body">
|
||||
<ul class="sidebar" ng-controller="sidebar">
|
||||
<li><pfm-search></pfm-search></li>
|
||||
@can('access-search')
|
||||
<li><pfm-search></pfm-search></li>
|
||||
@endcan
|
||||
<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>
|
||||
|
|
Loading…
Reference in a new issue