Record based permissions based on logged in user

jeroen

New member
Hi,

How can I filter shown results based on logged in user (not a group)
The user is registered in our database and has a relations with the records to be shown.
The user should only have permissions to see their own data not data of others.

What I functionally want:
If a user logs in I want him/her to see a list of their "devices", if a device is clicked I want to show an overview of the status (temperature. alerts, settings etc) of that device and buttons and fields to be be able to update or set values.

Can I do this? I am currently giving the Dadabik pro-version a try, if the above (and my question in a previous post) is possible I will definitely start using Dadabik in my front/back-end... Until now it looks very good and is easy to use :)

Thx!
 

eugenio

Administrator
Staff member
Hello,
check "Owner permissions" in the documentation, I might be exactly what you are looking for.

Best,
 

jeroen

New member
Hi Eugenio,

Thx for the very fast reply on this monday morning :)

I saw the owner permission part in the documentation but did not immediately see how I can use this.

My application/DB is setup in a way that:

Data from multiple devices is sent via MQTT and inserted in a messages table in the DB (with a generic DB user account).

I have a table with users and each user has a relation with an organization.
Each device has a relation with an organization.
Any user belonging to the organization should be able to view all data belonging to that organization. So there could be two different users (two employees from the same organization) that can view the same data of multiple devices.

Re reading the documentation I could probably handle the permissions the way I want to with "basing the ownership on the group instead of the user" when I add the organization id (basically my groups) to all records....? Am I right?

(I guess I will need the enterprise edition for this functionality? Can I upgrade this without having to pay a full new version?)

Thx
 

eugenio

Administrator
Staff member
Hello,
if the model doesn't fit your use case, for more generic rules, you can use "row level custom filters", see the video about it here:
https://dadabik.com/low-code-application-development-the-DaDaBIK-way

Yes you need Enterprise or Platinum, you can upgrade by paying the difference within 15 days from the purchase date.

Best,
 

jeroen

New member
awesome, exactly what I need.

I purchased pro 1 week ago.
How can we arrange the difference payment for upgrading to Enterprise?

Thx
 

mladen

New member
Hi,

i saw that low level filtering video and it works on single table.
But when i connect Master / details view, i get an error as it is looking for country filter from master table in details table

How can i apply this filter so it works also in details view?

br,
Mladen
 

mladen

New member
Hi,

yes. So i used the filter u showed in the video to filter records based on country code for group.

When i apply that filter, the main table works, but when i click on single record, which has linked record

if i use your example of albums and songs:

when i click on specific album which is filtered by country, in linked view it shows :

, it returns Unknown column 'album.country_code' in 'where clause'
 
Top