Extend-user permissions


#1

I included the extend-user repo into userfrosting. It mostly seems to work. However, when I select permission and then select an individual permission the server replies with 500. The JSON response is as follows:

message	SQLSTATE[42712]: Duplicate alias: 7 ERROR:  table name "members" specified more than once (SQL: select "users"."id", "users".*, "members"."city" as "city", "members"."country" as "country" from "users" inner join "role_users" on "users"."id" = "role_users"."user_id" inner join "permission_roles" on "permission_roles"."role_id" = "role_users"."role_id" left join "members" on "members"."id" = "users"."id" left join "members" on "members"."id" = "users"."id" where "permission_id" = 10 and "users"."deleted_at" is null and "users"."deleted_at" is null group by "users"."id" order by "last_name" asc limit 10)
exception	[…]
0	{…}
type	Illuminate\Database\QueryException
code	42712
message	SQLSTATE[42712]: Duplicate ali… by "last_name" asc limit 10)
file	/home/jose/yovoy/aig/sinma/rep…inate/database/Connection.php
line	647
1	{…}
type	Doctrine\DBAL\Driver\PDOException
code	42712
message	SQLSTATE[42712]: Duplicate ali…ers" specified more than once
file	/home/jose/yovoy/aig/sinma/rep…/DBAL/Driver/PDOStatement.php
line	107
2	{…}
type	PDOException
code	42712
message	SQLSTATE[42712]: Duplicate ali…ers" specified more than once
file	/home/jose/yovoy/aig/sinma/rep…/DBAL/Driver/PDOStatement.php
line	105

#2

Hi @cherry314159, please use Markdown to format stack traces - this will make them easier to read. I have fixed it for you this time.

It does indeed appear to be a bug, caused by Eloquent trying to join the members table twice - once in the global scope, and then again in the Sprunje. I’ll look into this.


#3

Actually, could you open an issue about this in the extend-user repo?