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

v1.3.11: users_groups, groups, and permission tables are orphans #163

Open
ghost opened this issue May 17, 2018 · 0 comments
Open

v1.3.11: users_groups, groups, and permission tables are orphans #163

ghost opened this issue May 17, 2018 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented May 17, 2018

Thanks for maintaining laravel-authentication-acl 👍

N.B. I haven't checked whether this affects later versions of laravel-authentication-acl.

In v1.3.11, laravel-authentication-acl seems to make migrations that create the following tables (among others) and leave them as orphans:

  • a users_groups table;
  • a groups table; and
  • a permission table.

The fact that these tables, in particular, are orphans, seems to be a bug. Why?

Because the users_groups.user_id column seems intended to draw its contents exclusively from the users.id column's contents. (So, ideally the migrations would declare a foreign-key relationship between the two.)

Similarly, the users_groups.group_id column seems intended to draw its contents exclusively from the groups.id column's contents. (So, ideally the migrations would declare a foreign-key relationship between the two.)

Also, there seems to be an implicit many-to-many relationship between the groups.permissions column and the entries in the permission table. Currently, laravel-authentication-acl appears to handle this by having the former contain text strings that are PHP arrays (I think) made by concatenating entries from permission.permission with surrounding boilerplate. This seems needlessly fragile and un-RDBMS-like. (Ideally, the migrations would instead create a groups_permission table, and declare foreign-key relationships betweengroups.id and groups_permission.group_id and between groups_permission.permission_id and permission.id.)

@ghost ghost changed the title v1.3.11: groups and users_groups tables are orphans v1.3.11: groups and users_groups tables are orphans May 17, 2018
@ghost ghost changed the title v1.3.11: groups and users_groups tables are orphans v1.3.11: users_groups, groups, and permission tables are orphans May 17, 2018
@intrip intrip added the bug label May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant