Selecting eSpaces web modules that user has permissions

Selecting eSpaces web modules that user has permissions

  
Hi, guys!!!! I´m using a query to return eSpaces that a user has permissions. Is there a way to return only web modules. The query is returning some modules thats has only business and data.

SELECT DISTINCT
{Espace}.*
FROM {Espace}
INNER JOIN {Role} ON {Espace}.[Id] = {Role}.[Espace_Id]
INNER JOIN {User_Role} ON  {Role}.[Id] = {User_Role}.[Role_Id]
WHERE
{User_Role}.[User_Id] = @UserId
AND {Espace}.[Is_Multitenant] = 1
AND {Espace}.[Is_Active] = 1
Hi Rogerio,

I do not think you can do that (or at least I don't know how), however, one thing I have done is queried the Application entity in order to find the application's front office espace or back office espace. Your query would most likely look something like this, you'll have to test it:

SELECT DISTINCT
{Espace}.*
FROM {Espace}
INNER JOIN {Role} ON {Espace}.[Id] = {Role}.[Espace_Id]
INNER JOIN {User_Role} ON  {Role}.[Id] = {User_Role}.[Role_Id]
INNER JOIN {Application} ON {Espace}.[Id] = {Application}.[Entry_Espace_Id] or {Espace}.[Id] = {Application}.[BackOffice_Espace_Id]
WHERE {User_Role}.[User_Id] = @UserId
AND {Espace}.[Is_Multitenant] = 1
AND {Espace}.[Is_Active] = 1
I hope that helps!
Cheers,

Isaac
Isaac, it works!!! Thank you!!!