mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 20:17:46 +02:00
refactor(auth): change contributor's role logic to have it included in the users_podcasts table
- update myth-auth and codeigniter to latest develop changes - improve permission check: remove all dynamic permissions per podcast and overwrite myth-auth services and permission filter - remove unnecessary code because of myth-auth upgrade - refactor some controller code for better clarity - add remaining seeders in docs closes #19, #20
This commit is contained in:
parent
e0da11517d
commit
58364bfed1
39 changed files with 1197 additions and 685 deletions
|
|
@ -17,39 +17,7 @@ class Episode extends BaseController
|
|||
|
||||
public function _remap($method, ...$params)
|
||||
{
|
||||
switch ($method) {
|
||||
case 'list':
|
||||
if (
|
||||
!has_permission('episodes-list') ||
|
||||
!has_permission("podcasts:$params[0]:episodes-list")
|
||||
) {
|
||||
throw new \RuntimeException(
|
||||
lang('Auth.notEnoughPrivilege')
|
||||
);
|
||||
}
|
||||
case 'edit':
|
||||
if (
|
||||
!has_permission('episodes-edit') ||
|
||||
!has_permission("podcasts:$params[0]:episodes-edit")
|
||||
) {
|
||||
throw new \RuntimeException(
|
||||
lang('Auth.notEnoughPrivilege')
|
||||
);
|
||||
}
|
||||
case 'delete':
|
||||
if (
|
||||
!has_permission('episodes-delete') ||
|
||||
!has_permission("podcasts:$params[0]:episodes-delete")
|
||||
) {
|
||||
throw new \RuntimeException(
|
||||
lang('Auth.notEnoughPrivilege')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$podcast_model = new PodcastModel();
|
||||
|
||||
$this->podcast = $podcast_model->find($params[0]);
|
||||
$this->podcast = (new PodcastModel())->find($params[0]);
|
||||
|
||||
if (count($params) > 1) {
|
||||
$episode_model = new EpisodeModel();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue