SuperAdminTech / api

0 stars 0 forks source link

Can the user return the application? #44

Closed nombrekeff closed 3 years ago

nombrekeff commented 3 years ago

Accounts return application, can the users return it too?

The reason for me wanting this is just to be able to show in caste.panel, where the users belong to, and filter by an application if wanted.

Nota46 commented 3 years ago

@nombrekeff could you explain this better? I'm checking this call /sadmin/users and in the response you get a list of users, each user with the account inside and inside the account there is the application. Is this enough or I'm missing something?

Nota46 commented 3 years ago

I could add a filter to retrieve all users by application like this 'GET', '/sadmin/users?permissions.account.application.id=05E88714-8FB3-46B0-893D-97CBCA859001'

nombrekeff commented 3 years ago

@nombrekeff could you explain this better? I'm checking this call /sadmin/users and in the response you get a list of users, each user with the account inside and inside the account there is the application. Is this enough or I'm missing something?

It's just to help reduce ugly code in the front end, I could get it from the list of permissions but it's not ideal. Are users not related to application?

'GET', '/sadmin/users?permissions.account.application.id=05E88714-8FB3-46B0-893D-97CBCA859001'

This filter would be great to have, so I can filter the users that belong to X account.

Nota46 commented 3 years ago

@nombrekeff no, users are not related directly to applications the relation is user -> permissions -> account -> application

I'm looking for a way to add application to user response

Nota46 commented 3 years ago

Hi @nombrekeff I'm connecting user with application...do you know if there are accounts without application? for example superadmin?

nombrekeff commented 3 years ago

Nop, they are related automatically on register, super admins belong to the default app

Nota46 commented 3 years ago

@nombrekeff another question...I've created a subscriber to add the application to user when the permissions are created, is it possible to change tha application for the company? if this is the case I should add a new subscriber to change the application for all the users inside an account when tha application for this account changes

nombrekeff commented 3 years ago

I'm not sure about this, but it's probable.

Let's see what @santoslluis says.

Nota46 commented 3 years ago

this is done, I'm gonna close the issue, feel fre to re-open if you need