bizley/yii2-podium

Moderator can't delete/edit post as admin

Totem4ik opened this issue · 10 comments

Hi, everyone.
I have a problem with moderator access. I install project, set config as in instruction.

in config file:
'modules' => [ 'podium' => [ 'class' => 'bizley\podium\Podium', 'userComponent' => [ 'class' => 'bizley\podium\web\User', 'identityClass' => 'app\models\User', ], 'adminId' => 100 ], ],
screenshot_1

Could someone explain, what i am doing wrong ?

  1. Why not set userComponent configuration simply like:

    'userComponent' => 'user',
    
  2. Is the ID of the user you are signed in with equal to 100?

  3. Was the 'adminId' => 100 configuration line set before Podium installation or after?

Hi, @bizley

  1. I emulated my main project. I have similar problem there.
'community' => [
            'class' => 'bizley\podium\Podium',
            'userComponent' => [
                'class' => 'bizley\podium\web\User',
                'identityClass' => 'app\models\Client',
            ],
            'adminId' => 1
        ],
  1. yes, for admin.
    I don't use db in test project, only default yii2 property in user model
private static $users = [
        '100' => [
            'id' => '100',
            'username' => 'admin',
            'password' => 'admin',
            'authKey' => 'test100key',
            'accessToken' => '100-token',
        ],
        '101' => [
            'id' => '101',
            'username' => 'demo',
            'password' => 'demo',
            'authKey' => 'test101key',
            'accessToken' => '101-token',
        ],
	'102' => [
		'id' => '102',
		'username' => 'test',
		'password' => 'test',
		'authKey' => 'test102key',
		'accessToken' => '102-token',
	],
    ];
  1. adminId was set after instalation yii2-podium

You need to set adminId before installation otherwise you will have to manualy change the role in db for this user to become admin.

@bizley but it wasn't answer on my question, admin access is good, my moderator can not edit/delete posts, i want to know what i could to do to fix that

So the screenshot is not for the administrator but for the moderator? In this case you need to sign in as the administrator and go to Administration > Members > View Member > Promote Member to Moderator - this will redirect you to the Moderators section where you can select one or more forums this moderator can moderate.

@bizley yes, i did it, but for some reason i don't see any moderator options.
i tried debug this, but i stoped on abstract class.

image

in code, here return false, when app try check access for moderator.
but from db all access exist

Is there any error stack given? To be honest I haven't checked how Podium behaves with static user array.

@bizley no any errors, but i repeat this strange thing with db and with static array

@bizley Maybe you coud help me with direction of this problem, while you try to fix?
I'll try to fix too.
It is important feature for my project and my client want see it.

I would strongly advise against using this module in any production ready project right now. I can not guarantee what will change and when - it's still beta. On top of everything I still haven't got time to focus on this...