Yii Framework Forum: [Module] Yii User Management Module - Yii Framework Forum

Jump to content

  • (29 Pages)
  • +
  • « First
  • 27
  • 28
  • 29
  • You cannot start a new topic
  • You cannot reply to this topic

[Module] Yii User Management Module Discussion, Bug Reports and Feature Requests for the User Management Rate Topic: ***** 4 Votes

#561 User is offline   Accilies 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 29-April 12

Posted 06 May 2013 - 03:10 PM

I have been working on this for a while now. Documentation really needs some improvements.

My question is related to permission & subordiate_id. How do I use that and how does it affect the permission system.

eg.

Action = Can_add_one 
Permission = To Role A 

Action = Can_add_two
Permission = To Role B


if I use subordinate when granting permission, how does it effect and how to use it?

Regards,
Shoeb Surya
0

#562 User is offline   dhimes 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 07-August 12

Posted 08 May 2013 - 09:21 AM

Hi Shoeb,

I've not used permissions, but since no one else is here I'll try to help. It looks like you might call

Yii::app()->user->can('actionName');

Incidentally, I had a difficult time with the unit tests shipped with YUM. Since I find it easier to explore how things work with unit tests, I struggled with this a bit. I found that adding

Yum::module('registration')->enableCaptcha = false;

into the RegistrationTest.php file allowed me to use the file on the module.

You can then explore the permissions system with code like

 $this->assertFalse(Yii::app()->user->can('save'));


HTH!
0

Share this topic:


  • (29 Pages)
  • +
  • « First
  • 27
  • 28
  • 29
  • 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