You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a roles table with a level field that I use to determine the level of permissions a user has. Naturally, every user is able to see every other user of the same level as them and above it. (So, a user with a role of level of 2 should be able to see every user with a role level of 2+)
I overrode the indexQuery method in the User resource to filter out users of a higher role than the role of the authenticated user.
The problem is that the roles table also contains a field called name, so in the list of users, the Name column is populated with the role's name, instead of the user's name.
I tried modifying the User's name field to Text::make('Name', 'users.name') but it didn't seem to work.
The text was updated successfully, but these errors were encountered:
I have a
roles
table with alevel
field that I use to determine the level of permissions a user has. Naturally, every user is able to see every other user of the same level as them and above it. (So, a user with a role of level of 2 should be able to see every user with a role level of 2+)I overrode the
indexQuery
method in theUser
resource to filter out users of a higher role than the role of the authenticated user.This is my method:
The problem is that the
roles
table also contains a field calledname
, so in the list of users, theName
column is populated with the role's name, instead of the user's name.I tried modifying the User's name field to
Text::make('Name', 'users.name')
but it didn't seem to work.The text was updated successfully, but these errors were encountered: