Difference between #3 and #4 of
Console Based CAuthManager Helper

Revision #4 has been created by bluyell on Apr 14, 2015, 6:49:50 PM with the memo:

helper. how to create a batch file for better usage.
« previous (#3)

Changes

Title unchanged

Console Based CAuthManager Helper

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

rbac, auth, CDbAuthManager, console, command

Content changed

[...]
./yiic foo rbac --c="assign sometask admin"
#test if the user admin has access to the operation
./yiic foo rbac --c="check someopr admin"
~~~

How to create a Batch file for better usability:
 
-----------------------------------------------
 
 
As i mention before the original yii-based command line usage is not appropiated for this kind of task:  
 
  
 
~~~
 
   ./yiic foo rbac --c="list operation"
 
~~~
 
 
In order to help you when using the command line, i suggest you to write a batch file:
 
 
~~~
 
  $yourshell cd /yourapp/protected 
 
  $yourshell touch rbac  #create a empty file.
 
  $yourshell chmod +x rbac  #assign execution privilegies
 
  $yourshell echo "./yiic foo rbac --c=\"$1 $2 $3 $4\"" >> rbac
 
~~~
 
 
As result, you can do it in this way:
 
 
~~~
 
  $yourshell cd /yourapp/protected 
 
  $yourshell ./rbac list operation
 
  $yourshell ./rbac query somerole
 
  $yourshell ./rbac create operation someoper
 
  ...
 
~~~
 
 
How to Setup
------------

The following steps will enable you to have basic console including a behavior designed to command your currently installed rbac feature. [Read more about install a CAuthManager based authentication manager](http://www.yiiframework.com/doc/guide/1.1/en/topics.auth#configuring-authorization-manager).

### Step1: Configure a CConsoleCommand
[...]
0 0
1 follower
Viewed: 12 907 times
Version: 1.1
Category: How-tos
Written by: bluyell
Last updated by: bluyell
Created on: Mar 29, 2015
Last updated: 9 years ago
Update Article

Revisions

View all history