Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing Issues while creating a Rule #13

Open
abdulquddus opened this issue Sep 29, 2015 · 4 comments
Open

Facing Issues while creating a Rule #13

abdulquddus opened this issue Sep 29, 2015 · 4 comments

Comments

@abdulquddus
Copy link

Hi,
Sorry could be a silly question. This is my first time to use RBAC in any YII2 project. I want to ask is what is the class name in the RULEs. As what ever I give to it got every class does not exist.
rules issue
Hope you won't mind of this silly question as I'm a learner. Thanks in advance.

@michaelnguyen2021
Copy link

You have to create class first before you can use it as rule . Read more ( http://www.yiiframework.com/doc-2.0/guide-security-authorization.html#using-rules)

@abdulquddus
Copy link
Author

I have created a class in backend\rbac folder with the name of ItemRules. Now when I create a Rule and give the classname as \backend\rbac\itemrules get the following error.

error 2

Keep in mind that this rbac folder is separated from the one in the vendor folder.
secondl y I gave namespace to backend\rbac at the top of the itemRules.php file. What am i doing wrong.

@Goancona
Copy link

Goancona commented Dec 5, 2015

Have you solvedd this? I have the same issue D:

@abdulquddus
Copy link
Author

Yes I've been able to solve the problem by creating a folder in the backend named it rbac. Then I have added all the rules one by one in that folder. When tried to create the rule "backend\rbac\AuthorRule" given this in the class name without quotes.

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

No branches or pull requests

3 participants