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

@schmunk42 schmunk42 commented Mar 28, 2014

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

@omnilight omnilight commented Mar 29, 2014

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

Loading

@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 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

@paskuale75 paskuale75 commented May 8, 2014

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

Loading

@samdark
Copy link
Member

@samdark samdark commented May 8, 2014

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

Loading

@paskuale75
Copy link

@paskuale75 paskuale75 commented May 8, 2014

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

Loading

@EvansonBarasa
Copy link

@EvansonBarasa EvansonBarasa commented Jan 19, 2015

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

Loading

@schmunk42
Copy link
Contributor Author

@schmunk42 schmunk42 commented Jan 19, 2015

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

Loading

@EvansonBarasa
Copy link

@EvansonBarasa EvansonBarasa commented Jan 19, 2015

yii_rbac_error
Here is a screen shoot of ./yii help

Loading

@cebe
Copy link
Member

@cebe cebe commented Jan 19, 2015

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

Loading

@lynicidn
Copy link
Contributor

@lynicidn lynicidn commented Jan 19, 2015

Loading

@schmunk42
Copy link
Contributor Author

@schmunk42 schmunk42 commented Jan 19, 2015

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

Loading

@lynicidn
Copy link
Contributor

@lynicidn lynicidn commented Jan 19, 2015

@schmunk42 ok :D

Loading

@EvansonBarasa
Copy link

@EvansonBarasa EvansonBarasa commented Jan 20, 2015

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

Loading

@samdark
Copy link
Member

@samdark 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/

Loading

@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants