Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Seperate entity by user (Table Row Ownership // Data - Segregation)
icon5.gif  Seperate entity by user (Table Row Ownership // Data - Segregation) [message #1760406] Wed, 26 April 2017 16:59 Go to next message
Source Deposit is currently offline Source DepositFriend
Messages: 3
Registered: March 2017
Junior Member

I use (scout 6.0.200) on (eclipse neon.2 Release 4.6.2)

The idea:
I want to separet the entities by the user.
Only user1 can see the content from "A". The user "administrator" can see the content from "A plus B".


I have a lot of entities ...
* Punching
* Embossing
* etc.

The entities have their own TablePages.

Now i create an segretation-table on postgres (or similar)

user | stock
=========================================================
user1 | A
user2 | B
administrator | A + B



All entity-table have also a "stock-column":

punching_id | mass | etc. | stock
===================================================
1234 | 13g | ... | A
5678 | 12kg | ... | B


Now i want to adjust all select-statements to consider the stock per user.


And these are my two problems (also not the select-statement -> wich user is it) ...

(A)
I think i must create a login page (username / password) to identify the user. But .... how? There is such a thing in eclipse scout framework? Someone has a tip?

(B)
In wich segmentation can i save the logged user? (to access the name in the select-statements)
Re: Seperate entity by user (Table Row Ownership // Data - Segregation) [message #1760441 is a reply to message #1760406] Thu, 27 April 2017 09:26 Go to previous messageGo to next message
R. van Twisk is currently offline R. van TwiskFriend
Messages: 12
Registered: April 2017
Junior Member
I am not very knowledable on JPA as I am a very 'classic' guy making Stored Procedures for about everything Smile
But from it sounds like you needs to read about defining JPQL Joins so you can join your entities by user and ensure the right user can only see the records assigned/available to him.

Cheers,
Ries

Re: Seperate entity by user (Table Row Ownership // Data - Segregation) [message #1760591 is a reply to message #1760441] Fri, 28 April 2017 16:57 Go to previous messageGo to next message
Source Deposit is currently offline Source DepositFriend
Messages: 3
Registered: March 2017
Junior Member

Hy Ries,

Thanks so lot ... I believe that select statement I get well ...

Can you help me with a login form? Or do you know where I can get further information? Specifically for the scout frame (scout 6.0.200)
Re: Seperate entity by user (Table Row Ownership // Data - Segregation) [message #1760597 is a reply to message #1760591] Fri, 28 April 2017 18:07 Go to previous messageGo to next message
R. van Twisk is currently offline R. van TwiskFriend
Messages: 12
Registered: April 2017
Junior Member
Hey,

I tell you honestly, I am currently just fooling around with the framework so I cannot give you solid advice.
I am playing with this : https://github.com/BSI-Business-Systems-Integration-AG/SpringBoot-and-EclipseScout and does show how to implement a login forum.
However,
from the looks of it you can implement any login system that you are familiar with, all it needs in the end is some valid session..

Ries
Re: Seperate entity by user (Table Row Ownership // Data - Segregation) [message #1760600 is a reply to message #1760597] Fri, 28 April 2017 18:34 Go to previous message
Source Deposit is currently offline Source DepositFriend
Messages: 3
Registered: March 2017
Junior Member

Hy Ries,

Ok, tip top ... thank you anyway. Then I read the "SpringBoot"
Previous Topic:Using maven to generate 'generated'?
Next Topic:Sidenav widget?
Goto Forum:
  


Current Time: Wed May 24 13:33:56 GMT 2017

Powered by FUDForum. Page generated in 0.03574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software