Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use migrations for RBAC tables #2913

Closed
schmunk42 opened this issue Mar 28, 2014 · 13 comments
Closed

Use migrations for RBAC tables #2913

schmunk42 opened this issue Mar 28, 2014 · 13 comments
Assignees
Milestone

Comments

@schmunk42
Copy link
Contributor

Would be nice if we could just run something like

./yii migrate/up --migrationPath @yii/rbac

To initialize the needed tables.

The docs should be updated accordingly:
http://stuff.cebe.cc/yii2docs/guide-authorization.html#using-db-based-storage-for-rbac

Not of the highest priority, but Yii should use migrations IMHO.

@omnilight
Copy link
Contributor

Currently RBAC tables use tbl_ prefix, that is not always suitable. For example I usually use {{%...} format. Moreover, it could be two or more separated groups of RBAC tables in the single db (one for users in front-end and the second is for backend). So I think that if it would be migrations for RBAC,they have to use some kind of parameters to ask for correct table names

@cebe cebe added this to the 2.0 RC milestone Mar 29, 2014
@samdark samdark self-assigned this May 4, 2014
@samdark samdark closed this as completed in 42c5669 May 6, 2014
cebe added a commit that referenced this issue May 6, 2014
* 'master' of github.com:yiisoft/yii2: (43 commits)
  `BaseActiveRecord::findAll()` comment fix
  Fixes #2913: RBAC `DbManager` is now initialized via migration
  [NL] Removed app.php
  [NL] brought translations up to date
  Fix for comparing numeric attributes in JavaScript
  Better Gii caption english
  Fix for comparing numeric attributes in JavaScript
  HHVM compatibility Fixes for Yii 2 Console Application
  Rough creation of a doc style guide
  typo
  Finished Edits
  Edited up to Active Record
  renamed chapter to section [skip ci]
  Catalan translation
  Edited up through "I18N"
  Cleaned Up
  updated guide toc [skip ci]
  Update concept-behaviors.md
  Fixed wrong links [skip ci]
  Fixed document for multisort in BaseArrayHelper
  ...
@paskuale75
Copy link

I run first migration (init) then rbac (with migrationPath=..... option) it return me "No new migration found. Your system is up-to-date !!" Why ?

@samdark
Copy link
Member

samdark commented May 8, 2014

Have you run yii migrate --migrationPath=@yii/rbac/migrations/?

@paskuale75
Copy link

sorry ... I launched yii migrate --migrationPath=vendor/yiisoft/yii2/rbac/migrations
thanks for reply ;)

@EvansonBarasa
Copy link

After executing yii rbac/init I get this error Error: Unknown command "rbac/init"!!!!!!!! any help?

@schmunk42
Copy link
Contributor Author

@EvansonBarasa Could you show us your output of ./yii help

@EvansonBarasa
Copy link

yii_rbac_error
Here is a screen shoot of ./yii help

@cebe
Copy link
Member

cebe commented Jan 19, 2015

there is no ./yii rbac/init command, where did you get that from?

@lynicidn
Copy link
Contributor

@schmunk42
Copy link
Contributor Author

@lynicidn You should create an issue there, I think.

@lynicidn
Copy link
Contributor

@schmunk42 ok :D

@EvansonBarasa
Copy link

@cebe yii rbac/init command from yii 2.0 definitive guide

@samdark
Copy link
Member

samdark commented Jan 20, 2015

https://github.com/yiisoft/yii2/blob/master/docs/guide/security-authorization.md#building-authorization-data

@EvansonBarasa this command isn't built-in but the one you should create. Anyway, it's done multiple times w/o issues so it's unlikely that there's an issue with framework itself. If you still have trouble please use official 2.0 forum to get help: http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/

@yiisoft yiisoft locked and limited conversation to collaborators Jan 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants