Open paskuale75 opened 2 years ago
Hi @paskuale75
Yes, that's because the controller has no access behaviors
registered by default. If you'd like to change this, I think it's the easiest why you register them via app config
.
Hi @paskuale75 Yes, that's because the controller has no
access behaviors
registered by default. If you'd like to change this, I think it's the easiest why you register them viaapp config
.
Thanks @simialbi register them via app config
, have you small example for this ?
It should work like this (untested):
'components' => [
// ...
],
'container' => [
'definitions' => [
'simialbi\yii2\elfinder\controllers\ConnectionController' => [
'as access' => [
'class' => 'yii\filters\AccessControl',
'rules' => [
[
'allow' => true,
'actions' => ['index'],
'roles' => ['@']
]
]
]
]
]
]
ok @simialbi I will try as you advised me, two questions: 1) could you add it as an option in the component and the second... 2) where can I learn more about the possibility of managing this container ?
Thanks
Thanks @simialbi it works fine, only one thing being a response json does not redirect at login but returns the message 403 forbidden, do you have any advice to redirect the login page when the session expires ?
It's not this easy. The problem here is, that it's not a regular pjax request from the framework which would redirect if a 301 header is sent. It's an ajax request from elfinder.js itself...
Therefore the only hope is to have this attitude from inside the component ? Thanks
Would that really change anything? If the mask is already rendered, you'll see the exact same behavior, don't you?
When the time expires and the user is no longer logged in, elfinder continues to do operations as if nothing happened.