Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Moderator can't delete/edit post as admin #135

Open
Totem4ik opened this issue Apr 13, 2018 · 10 comments
Open

Moderator can't delete/edit post as admin #135

Totem4ik opened this issue Apr 13, 2018 · 10 comments
Labels

Comments

@Totem4ik
Copy link

Totem4ik commented Apr 13, 2018

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 ?

@bizley
Copy link
Owner

bizley commented Apr 13, 2018

  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?

@Totem4ik
Copy link
Author

Totem4ik commented Apr 16, 2018

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

@bizley
Copy link
Owner

bizley commented Apr 16, 2018

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 bizley closed this as completed Apr 16, 2018
@Totem4ik
Copy link
Author

@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

@bizley
Copy link
Owner

bizley commented Apr 16, 2018

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.

@Totem4ik
Copy link
Author

@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

@bizley
Copy link
Owner

bizley commented Apr 16, 2018

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

@bizley bizley reopened this Apr 16, 2018
@bizley bizley added the bug label Apr 16, 2018
@Totem4ik
Copy link
Author

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

@Totem4ik
Copy link
Author

@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.

@bizley
Copy link
Owner

bizley commented Apr 17, 2018

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...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants