How can I ensure users only see records created by themselves?

Show records belonging to the logged on user


where:
field = {your user element}
condition: equals
value: {$my->id}

type=text
 
Can you help me - I can only see the wood and not the trees!

Folks

I have tried to get this to work but clearly I am missing something. I have created the user element and made it hidden (see 1st image). I have then setup the filter using a variety of different element (see 2nd image) including one that just says raw (see last image). I then create a menu item linking to the list I want to display but it returns "No Records"

user_element.png


filter.png


raw.png

Can anyone tell me what I am doing wrong please?

Thanks
 
Just to check: Does the user you are logged in as have any records in the list? You have "update on edit" set to "no" so you will need to create new records for that user in order to view anything.
 
Thanks Rackem i changed it to update on edit and it is now working properly - thanks for your help :)

Sorry I haven't been back to report - It seems it hasn't been resolved - I will have to leave it at the moment as I have a lot to do with the site and this is a nice to have as opposed to a need to have

AcidRainZ said:
does this work in fabrika 3.x?
Don't know sorry :)
 
I tried user element and pre-filters. Everything is working fine except that even Super User is not able to see all the data.

I want public and Super User to see all the data but registered user to see and edit their data only
 
In your form add a "username" element, called "username" This element automatically inserts the current user's userid into your form as a hidden field.

Now each time you users adds a record, via the form, to the database table, their user id is also recorded.

The second thing to do is to edit your table, and add a prefilter so that each user sees only the records that they have created:

  • Edit your form's table.
  • Select the "data" tab
  • Under the "prefilter" section press "add filter"
  • Select "username" from the field dropdown (the "username" element we previously created)
  • Select "EQUALS" from the condition drop down list
  • Enter "{$my->id}" (without the quotes) into the "value" field
  • Select "super administrator" from the filter drop down. NOTE ! - this means that the filter is applied to everyone EXCEPT the super administrator. So in our case normal users will see only their records, where as the super administrator will see all the records
  • Save your table

Hi Rob,
Thank you for the wonderful tutorial, it works fine, however, I do not seem to find that part of filter drop down where I should select super administrator. was it removed in the current version of Fabrik? is there an alternative to except super administrator from this condition?
Thanks a mil.
 
This description is 12 years old. I don't know how the "Apply to" was working at this time. Joomla's groups/accesslevels structure was pretty different.

You may create an accesslevel not associated with your (super)admins and apply the pre-filter to this level
or you add a second pre-filter with OR with a condition allways true and apply this to your (super)admins accesslevel only.

http://fabrikar.com/forums/index.php?wiki/Prefilters-for-Front-End-Users-Only/
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top