Yii Framework Forum: Does Anyone Have A Working Example Of Rbac? - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Does Anyone Have A Working Example Of Rbac?

#21 User is offline   Gregoire 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 11-March 10

Posted 29 July 2014 - 05:31 AM

Note that if I'm right then the official doc should be fixed: Basic information about RBAC
0

#22 User is offline   Stratigos 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 57
  • Joined: 14-September 11
  • Location:BROOKLYN

Posted 17 December 2014 - 05:16 PM

View PostGregoire, on 29 July 2014 - 05:31 AM, said:

Note that if I'm right then the official doc should be fixed: Basic information about RBAC



Yah im now learning the hard way that the official doc is pretty out of date with what should be done to implement this. So much source code to read to figure out how this works! Im just going to abandon RBAC altogether now lol.
0

#23 User is offline   Marcel Marnix 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 17-May 14
  • Location:Holland

Posted 25 December 2014 - 08:54 AM

Does anyone have a working example of YII2 RBAC PhpManager with a working update own post??
(With the Yii advanced template)

Because I want thousands of special users to be able to update own posts and images.

I don't think it is that hard but after googling for weeks I only get lots of information not to use the DbManager
because it will create lots of extra db calls.

And not how to theoraticly set up RBAC to update own posts...

The best working example with RBAC is http://www.yiiframew...anced-template/
And I've asked the developer to ad a simple posts table to update own posts...

Thanks in advance!!
hatsyii (I even sneeze yii)...
0

#24 User is offline   Lukos 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 103
  • Joined: 10-February 11

Posted 14 January 2015 - 07:40 PM

You can place the check in the behaviors() function to easily control access to actions but you can also use it 1) in views to show and hide things based on permissions (you should use permissions rather than roles) and also you might need finer control over permissions such as if user has permission X then a post is added with a property set to something, otherwise it is not set. That kind of fine grained control can live in the action function itself.

I made a video about rbac in case anyone's interested. The concept takes longer to understand than it does to code it.

https://www.youtube....h?v=vLb8YATO-HU
The first 90% of the work takes 10% of the time
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • 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