mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 20:17:46 +02:00
refactor(auth): replace myth/auth with codeigniter/shield + define new roles
closes #222
This commit is contained in:
parent
c760acc79d
commit
c1287cbe6c
213 changed files with 3366 additions and 3204 deletions
|
|
@ -23,7 +23,6 @@ use App\Models\PlatformModel;
|
|||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use Config\Services;
|
||||
use ErrorException;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
|
||||
|
|
@ -201,10 +200,11 @@ class PodcastImportController extends BaseController
|
|||
->with('errors', $podcastModel->errors());
|
||||
}
|
||||
|
||||
$authorize = Services::authorization();
|
||||
$podcastAdminGroup = $authorize->group('podcast_admin');
|
||||
|
||||
$podcastModel->addPodcastContributor(user_id(), $newPodcastId, (int) $podcastAdminGroup->id);
|
||||
// set current user as podcast admin
|
||||
// 1. create new group
|
||||
config('AuthGroups')
|
||||
->generatePodcastAuthorizations($newPodcastId);
|
||||
add_podcast_group(auth()->user(), $newPodcastId, 'admin');
|
||||
|
||||
$podcastsPlatformsData = [];
|
||||
$platformTypes = [
|
||||
|
|
@ -460,9 +460,7 @@ class PodcastImportController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
// set interact as the newly imported podcast actor
|
||||
$importedPodcast = (new PodcastModel())->getPodcastById($newPodcastId);
|
||||
set_interact_as_actor($importedPodcast->actor_id);
|
||||
|
||||
// set podcast publication date
|
||||
$importedPodcast->published_at = $firstEpisodePublicationDate ?? $importedPodcast->created_at;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue