Yii Framework Forum: Users are Confused about Yii2 RBAC DBMANAGER - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Users are Confused about Yii2 RBAC DBMANAGER Nothing making sense to newbies with RBAC, Rate Topic: ****- 2 Votes

#1 User is offline   Jairus Martin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 03-April 17

  Posted 12 April 2017 - 10:29 PM

This artical is an initial draft; I will refine the thoughts below as I go on living.

Intro
The purpose of this discussion is to help the Yii community better onboard newbs.

For example, the seemingly simple task of configuring RBAC with dbManager is maybe a 15min task for a vet, a newb it is weeks if they hit a small snag.

The Issue
A newbie is easily hung up on components, modules and the config file in general. The Yii website guides or wiki articles I find are given step by step but with no here is why explanation.

Example
Yii2 RBAC Wiki Article
In the above link, the "as access" config array is stumping many newbs, and when I stepped back I can understand why.



The Questions Needing Answers
  • Why do I have to use the verbiage "as access" instead of "whatever"?
  • Where is a complete listing of components, modules that can be configured?
  • Where are the roadmaps for small, medium and large scale projects housing one or many sub applications?


Suggestions
One observation, I attempted to improve a wiki article but was denied access for being too new. The inability to quickly develop an article I think is doing more harm than good. Don't we want to rapidly improve articles, which will also help grow the community? I understand the down sides of having something too open, but that is why we have moderators and volunteers like StackOverflow does.
2

#2 User is offline   Nikola Tesic 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 04-June 17

Posted 04 June 2017 - 05:20 PM

View PostJairus Martin, on 12 April 2017 - 10:29 PM, said:

This artical is an initial draft; I will refine the thoughts below as I go on living.

[*] Why do I have to use the verbiage "as access" instead of "whatever"?


"as access" is actually behavior 'access'
1

#3 User is offline   Jairus Martin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 03-April 17

Posted 04 June 2017 - 10:14 PM

True, but "as" is the critical keyword, the access part could be called anything.

For example: 'as bunny' instead of 'as access's would work.
1

#4 User is offline   newbiedo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 28-June 12

Posted 08 June 2017 - 05:58 PM

I re-read it 5 times and can't find where it says 'as access'. I used this wiki as a guide to setting up my RBAC and I don't have that in my application either.
0

#5 User is offline   Nikola Tesic 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 04-June 17

Posted 09 June 2017 - 03:22 AM

View Postnewbiedo, on 08 June 2017 - 05:58 PM, said:

I re-read it 5 times and can't find where it says 'as access'. I used this wiki as a guide to setting up my RBAC and I don't have that in my application either.

http://www.yiiframew...ching-behaviors

It is simple behavior, defined in config file
0

#6 User is offline   newbiedo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 28-June 12

Posted 09 June 2017 - 10:23 AM

View PostNikola Tesic, on 09 June 2017 - 03:22 AM, said:

http://www.yiiframew...ching-behaviors

It is simple behavior, defined in config file

I was talking about the link to the wiki article, I guess I am missing something.
0

#7 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,588
  • Joined: 10-October 10
  • Location:Denmark

Posted 09 June 2017 - 10:35 AM

To answer our question:

Quote

The as behaviorName elements specify what behaviors should be attached to the object. Notice that the array keys are formed by prefixing behavior names with as ; the value, $behaviorConfig, represents the configuration for creating a behavior, like a normal configuration described here.



http://www.yiiframew...guration-format
"Less noise - more signal"
0

#8 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,588
  • Joined: 10-October 10
  • Location:Denmark

Posted 09 June 2017 - 10:37 AM

But, yes: the "as something" is nowhere to be found in that linked to wiki article. And it has never been there (judging by the history of the page).
"Less noise - more signal"
0

#9 User is offline   Jairus Martin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 03-April 17

Posted 10 June 2017 - 09:15 AM

View Postnewbiedo, on 08 June 2017 - 05:58 PM, said:

I re-read it 5 times and can't find where it says 'as access'. I used this wiki as a guide to setting up my RBAC and I don't have that in my application either.


Referring to the setup with //github.com/mdmsoft/yii2-admin. I should have clarified, the yii2-admin by mdmsoft quickly allows you to get up and going. However, people placed some tutorials out there with some mistakes that misguided users where to place the behavior class. I.e. people were placing the 'as access' behavior which declared the class for access control in the components section. Because I could not edit the article, I could not fix the documentation error.

    'as access' => [
        'class' => 'mdm\admin\components\AccessControl',
        'allowActions' => [
            'site/*',       // Leave for guest access.
        ]
    ],

1

#10 User is offline   Nikola Tesic 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 04-June 17

Posted 12 June 2017 - 02:30 AM

View Postjacmoe, on 09 June 2017 - 10:37 AM, said:

But, yes: the "as something" is nowhere to be found in that linked to wiki article. And it has never been there (judging by the history of the page).


You have behavior "access" example in mention link http://www.yiiframew...admin-and-user/ under Step 6.

So when you have example of behavior access, it is easy to implement to config file as "as access"
0

#11 User is offline   newbiedo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 28-June 12

Posted 12 June 2017 - 04:25 PM

View PostJairus Martin, on 10 June 2017 - 09:15 AM, said:

Referring to the setup with //github.com/mdmsoft/yii2-admin. I should have clarified, the yii2-admin by mdmsoft quickly allows you to get up and going. However, people placed some tutorials out there with some mistakes that misguided users where to place the behavior class. I.e. people were placing the 'as access' behavior which declared the class for access control in the components section. Because I could not edit the article, I could not fix the documentation error.

    'as access' => [
        'class' => 'mdm\admin\components\AccessControl',
        'allowActions' => [
            'site/*',       // Leave for guest access.
        ]
    ],



Gothcha, thanks for the clarification.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users