Closed pkjoshisbp closed 4 years ago
I think it will be safe to check empty
instead of null
because empty
will check null
value as well. So the executeRule
method will be as below.
protected function executeRule($user, $item, $params)
{
if (empty($item->ruleName)) {
return true;
}
}
@pkjoshisbp, I'm not sure about how Yii migration supports to MongoDB. But I guess it may be from your end the MongoDB treats the PHP null
value as ""
empty string. It will be much better if you confirm about it.
It has been 2 or more weeks with no response on our request for more information. In order for our issue tracker to be effective, we are closing this issue.
If you want it to be reopened again, feel free to supply us with the requested information.
Thanks!
This is an automated comment, triggered by adding the label expired
.
What steps will reproduce the problem?
like create a auth-item and in config add
when I add a auth_item admin in mongodb, the ruleName is saved as
""
instead of null value or even when I save it asnull
orundefined
by directly from mongo shell, it raised another error asundefined index
for ruleName. so even when rule is empty, the protected method in yii2\rbac\BaseManager.phpit raised error like
What is the expected result?
expected result is obvious that is whether rule is Null or empty, it should not raise error.
What do you get instead?
mentioned above.
Additional info