Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

uncompleted documentation cookbook/security/entity_provider.html #2756

Closed
Labels
DoctrineSecurityactionableClear and specific issues ready for anyone to take them.
@gondo

Description

@gondo

This tutorial needs more love. Here is a list of few things what i found confusing or incorrect:

  • 1. discrepancy in table names. table "acme_users" declared in user class, but table "user" referenced in select queryselect * from user;
  • 2. missingcreate table users description. (this can be guessed by putting together information from annotations from user class and provided output of select query, but why so complicated?)
  • 3. missing reference on how to generate passwords with salt (provided link gives vague general idea but does not give answer on how to create password what would be usable in presented example)
  • 4. some random, unexplained and possibly unrelated code:cleaning #2753
  • 5.you can still authenticate with maxime - this is confusing, as it is the first time that somemaxime is mentioned. missing password formaxime and missing reference to when this authentification should be tried for the first time. also this would not work because user class is referencingUserRepository in annotation, butUserRepository was not yet defined. (it will be later in the tutorial)
  • 6. missingcreate table acme_groups declaration.
  • 7.Group should be renamed toRole to avoid unnecessary confusion, and it should be declared asclass Role implements RoleInterface
  • 7. tutorial should mention how to generate missing setters/getters byphp app/console doctrine:generate:entities Acme/UserBundle (this does it for both User and Group as perhttp://symfony.com/doc/current/book/doctrine.html#generating-getters-and-setters )
  • 8. missing at least 1 working example of user and password for testing (f.e.: u: 'admin', p: 'password', p-hash: 'd033e22ae348aeb5660fc2140aec35850c4da997', salt: '')
  • 9. missing at least 1 working example of role/group and user assignment to this role/group.
  • 10. missing explanation how is the user mapped to the role/group. this time not evenselect * from groups is provided

Question:

how should the user role be saved in thegroups table?
this is my users table

idusernamesaltpasswordemailis_active
1admind033e22ae348aeb5660fc2140aec35850c4da997admin@admin.com1

and this is my current groups table:

idnamerole
1adminROLE_ADMIN

but when i login as admin/admin (yes admin is the correct password) the user role on return is empty.

Answer

ok i've noticed that after running table doctrine:generate:entities there is one more table created what mapps user to the role.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DoctrineSecurityactionableClear and specific issues ready for anyone to take them.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp