Yii Framework Forum: [EXTENSION] srbac : Web interface for the administration of rbac - Yii Framework Forum

Jump to content

  • (38 Pages)
  • +
  • « First
  • 31
  • 32
  • 33
  • 34
  • 35
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] srbac : Web interface for the administration of rbac Rate Topic: ****- 7 Votes

#641 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 02 July 2010 - 12:39 AM

View Postjeremy, on 24 June 2010 - 02:50 PM, said:

new bug report: (v209)
If you continue, it appears to keep stacking up the entries. Only way is to press the "Gear" icon to get a fresh copy of the page. I assume this is something due to AJAX subforms - but haven't debugged at all.


The multiple submits seemed that were caused by the $live = true parameter in CHtml::clientChange called by the ajaxsubmitbutton, I overidden it in SHtml and it seemed to work now. Please check the code from svn


View Postjeremy, on 27 June 2010 - 11:08 AM, said:

Hi Spyros,

it's almost but not quite fixed. Works ok to save a new Auth_item with non-empty [data] field. But if you edit an Auth_item with data, and change the data, it is redisplayed in the form in serialized form. For some reason I don't know, the AfterFind() is not working in this context. As soon as the Save button is pressed in Edit Auth_Item panel, after [data] is changed from existing value to new value, then the new value is redisplayed in serialized form.

- Jeremy



I also fixed this in svn, please take a look
0

#642 User is offline   jeremy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 57
  • Joined: 17-June 09
  • Location:Massachusetts, USA

Posted 05 July 2010 - 02:44 PM

Hi Spyros,

Thanks for the fixes. I checked the most recent version (v214) from SVN. It's almost working. The bug which was duplicate-creating AuthItems is fixed. The bug of not serializing the [data] field is fixed. But there is one more issue related to serializing:

To recreate the new bug:
1. Press the Gear icon
2. press "create" button in left panel
3. enter name "Test1", select type "Role"
4. press "create" button in right panel. Get flash message 'test1 created successfully'
[data] field is still blank - good
5. on the "test1" item, enter "somedata" in [data] field, and press "save"
now [data] field shows [s:8:"somedata":], which is the serialized version. this is the error
you can update the field by replacing the entire contents, but each time Save is pressed, the serialized version is display.

This is a really great tool - thanks for creating and maintaining it, and for responding to all the requests for new features and fixes.
0

#643 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 05 July 2010 - 11:04 PM

Thanks,
I have fixed it in svn
There's still a problem with the autocomplete textfield that sends some dozens of queries each time so I will upgrade to Yii 1.1.3 and use the
CJuiAutocomplete instead , then I will release the new fixed version.
If there are still some problems let me know


0

#644 User is offline   Maxximus 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 146
  • Joined: 24-November 08
  • Location:Spain

Posted 08 July 2010 - 08:44 AM

Hi, the SVN version doesn't support actions anymore. At least not if these actions are in a subdir, like this:

Controller:
/controllers/admin/ReportController.php
actions in:
/controller/admin/report/TurnoverAction.php


Autocreate will give a 500 error in the Ajax call for the controller.
0

#645 User is offline   jeremy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 57
  • Joined: 17-June 09
  • Location:Massachusetts, USA

Posted 08 July 2010 - 10:33 AM

Thanks, the problem of serialized data showing is fixed in v215 from SVN.


View PostSpyros, on 05 July 2010 - 11:04 PM, said:

Thanks,
I have fixed it in svn
There's still a problem with the autocomplete textfield that sends some dozens of queries each time so I will upgrade to Yii 1.1.3 and use the
CJuiAutocomplete instead , then I will release the new fixed version.
If there are still some problems let me know



0

#646 User is offline   WalrusTheGreat 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 06-May 10
  • Location:Bucharest, Romania

Posted 14 July 2010 - 03:22 AM

Hello,

Is there any option to load User.php class from another location (like a user module)?

For now I added in my copy of SRBAC,
>config/main.php
  'userclassPath' => 'modules.hr.models.User'


and in

>SrbacModule.php
  public $userclassPath = '';

  public function getUserModel() {
    if(!empty($this->userclassPath)){
      include_once Yii::app()->basePath.DIRECTORY_SEPARATOR.str_replace('.', DIRECTORY_SEPARATOR, $this->userclassPath).'.php';
    }
    return new $this->userclass;
}


Thx, and keep up with the good job!
0

#647 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2010 - 03:33 AM

View PostWalrusTheGreat, on 14 July 2010 - 03:22 AM, said:

Hello,

Is there any option to load User.php class from another location (like a user module)?



Let's say your user model is in module:usersmodule
You have to import it in main.php config file
<?php
// autoloading model and component classes
    'import'=>array(
        'application.modules.usersmodule.models.User',
        ),
?>


and add it in srbac config
<?php 
'userclass'=>'User',
?>

0

#648 User is offline   WalrusTheGreat 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 06-May 10
  • Location:Bucharest, Romania

Posted 14 July 2010 - 03:39 AM

View PostSpyros, on 14 July 2010 - 03:33 AM, said:

Let's say your user model is in module:usersmodule
You have to import it in main.php config file
<?php
// autoloading model and component classes
    'import'=>array(
        'application.modules.usersmodule.models.User',
        ),
?>



That was fast reply, and solved the problem, thx again.
0

#649 User is offline   WalrusTheGreat 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 06-May 10
  • Location:Bucharest, Romania

Posted 14 July 2010 - 03:42 AM

Small issue,

If I have an action like this:

public function actionAdmin($mParams = ''){}


Auto Create Auth Items try to build:

hr_UserAdmin$mParams=''


and fails, because of quotes.

I add them by hand now.
1

#650 User is offline   PaulDi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 17-January 10
  • Location:UK

Posted 18 July 2010 - 09:04 AM

Hi, I've started looking at srbac and it looks great. I think I've got it mostly working but have a question:

  • The standard yii controller base class (Controller.php) has menu, layout and breadcrumb properties. I can only find breadcrumb properties in the AuthitemController. Is AuthitemController the correct base class to use in order to get automatic auth or is there another base class that implements the menu and layout properties? I'm sure there's a good reason but it seems odd that SBaseController didn't just inherit from Controller.php in the first place to retain the standard properties.


Thanks in advance,
Paul.
0

#651 User is offline   xgarb 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 19 July 2010 - 12:25 PM

Hi all,

Working my way through a few experiments with Yii. Got Yii-User installed.. now working on srbac.

Have this error on the Installation Check page:

srbac is not Configured
Property "SrbacModule.relations" is not defined.


Not sure what the relations are the error refers to.. wondered if it was 'cos I'm using Yii-User module as the user class?

part of import array..
'application.modules.srbac.controllers.SBaseController',
'application.modules.user.models.User',


part of modules array..
'srbac' => array(
'userclass'=>'User', //default: User
'userid'=>'id', //default: userid
'username'=>'username', //default:username


***EDIT***

If I comment out the following (line 76 of protected\modules\user\models\User.php)

if (Yii::app()->controller->module->relations) array_merge($relations,Yii::app()->controller->module->relations);

In the Yii-User module it works! Still learning this stuff.. is this attemping to merge all the model relations into one array?
0

#652 User is offline   coma 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 20 July 2010 - 02:53 AM

Description

CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'yii.assignments' doesn't exist

I get this error when i'm trying to run the installation page. Does this mean I have to create tables for rbac manually? If so, where can I find the description for the structure?

-------------------------------------------------------------------------------------------
UPDATE:
-------------------------------------------------------------------------------------------

Resolved the problem, found the DB schema under /framework/web/auth/schema.sql
0

#653 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 416
  • Joined: 24-May 09
  • Location:Brazil

Posted 23 July 2010 - 06:21 AM

hey, guys!

could you please tell me if the following is possible by using bizrules, because i can't figure out how to perform the task i want

User
userId
userName
userPassword
userLevel (1-site admin, 2-client admin, 3-common)

Company
companyId
companyName

User_Manage_Company
userId
companyId

Offer
offerId
offerDate
offerCompanyId

relations are
user -> company is many_many
company -> offer is has_many

Site admin should be able to manage, create and update/delete everything
Client Admin should be able to manage *only* those offers belonging to the companies their are allowed to manage
Common user should be able to change their profile


my main problem in here is the second statement:
"Client Admin should be able to manage *only* those offers belonging to the companies their are allowed to manage"


I know that in admin/index actions i'll have to include some criteria to filter the data, but in create/update/delete actions, the system should check for the rule i told

could somebody please give me a hint?

thanks

:)
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
0

#654 User is offline   Jun 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 13-July 10

Posted 28 July 2010 - 04:54 AM

View Postxgarb, on 19 July 2010 - 12:25 PM, said:

Hi all,

Working my way through a few experiments with Yii. Got Yii-User installed.. now working on srbac.

Have this error on the Installation Check page:

srbac is not Configured
Property "SrbacModule.relations" is not defined.


Not sure what the relations are the error refers to.. wondered if it was 'cos I'm using Yii-User module as the user class?

part of import array..
'application.modules.srbac.controllers.SBaseController',
'application.modules.user.models.User',


part of modules array..
'srbac' => array(
'userclass'=>'User', //default: User
'userid'=>'id', //default: userid
'username'=>'username', //default:username


***EDIT***

If I comment out the following (line 76 of protected\modules\user\models\User.php)

if (Yii::app()->controller->module->relations) array_merge($relations,Yii::app()->controller->module->relations);

In the Yii-User module it works! Still learning this stuff.. is this attemping to merge all the model relations into one array?



I'm having exactly same issue...I'd like some hints too.
0

#655 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 05 August 2010 - 05:46 AM

View Postpaulie, on 18 July 2010 - 09:04 AM, said:

Hi, I've started looking at srbac and it looks great. I think I've got it mostly working but have a question:

  • The standard yii controller base class (Controller.php) has menu, layout and breadcrumb properties. I can only find breadcrumb properties in the AuthitemController. Is AuthitemController the correct base class to use in order to get automatic auth or is there another base class that implements the menu and layout properties? I'm sure there's a good reason but it seems odd that SBaseController didn't just inherit from Controller.php in the first place to retain the standard properties.


Thanks in advance,
Paul.


Controller is not a Yii core class. It's created by the yicc tool so we can't depend that it will always be available.
The solution is to add the menu and layout properties in SBaseController
0

#656 User is offline   pinchbeck 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 13-August 10

Posted 19 August 2010 - 11:44 AM

Hey you guys,

first of all, thank you - spyros - for the great extension!

I was looking for a way to use bizrules with my tasks and ended up trying different variations of "return 1==1", "return true" and so on about over an hour, until i figured out that i just had to add a semicolon at the end of it, like "return true;"

So i just wanted to add this to this thread and warn other newbs like me, maybe this is going to help someone else.

If you want to use bizrules with the extension be sure to add a semicolon at the end of your rule, unless you're not planing to almost freak out like me ;)

over and out
0

#657 User is offline   Deepak Pradhan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 209
  • Joined: 01-May 09
  • Location:Charlotte, NC

Posted 29 August 2010 - 12:58 AM

Hi Spyros

Is the any configuration needed for SRBAC to work with the sub modules? I am using 1.1 and latest updates from SVN
0

#658 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 30 August 2010 - 02:03 AM

The automatic creation of authitems doesn't scans submodules yet.
You can create the auth items manual with the proper naming and it should work
0

#659 User is offline   Deepak Pradhan 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 209
  • Joined: 01-May 09
  • Location:Charlotte, NC

Posted 01 September 2010 - 12:46 AM

View PostSpyros, on 30 August 2010 - 02:03 AM, said:

The automatic creation of authitems doesn't scans submodules yet.
You can create the auth items manual with the proper naming and it should work


Thanks a lot. I will do so. Keep up your good work :)
0

#660 User is offline   Juan Pablo Sala 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 16-June 09

Posted 01 October 2010 - 02:40 PM

Hi, I may be wrong, but it seems that now some items are created with $id at the end.
My fix was to append this:
if (in_array($access.'$id', $this->allowedAccess())) {
return true;
}
in the beforeAction.

Thanks for your excellent work!!
0

Share this topic:


  • (38 Pages)
  • +
  • « First
  • 31
  • 32
  • 33
  • 34
  • 35
  • Last »
  • 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