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

Not sure what you mean by seeing an edit option for a table on a form. Are you talking about the related data feature?

-- hugh
 
hello all
rob

  • 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

i am apply this steps , only in pre filter select the "publisher" group
but not work ... ???


Of course it work with select administrator group .

thanks
 
i am want to shown all tables that filled by any user for " publisher group"

and select the publisher group in the pre filter & all steps for this (EQUALS - {$my->id} - no-quotes )

but with this changes, the publisher only can view and edit own forms

your idea ?
thanks
 
What field are you filtering on? A 'user' element?

Sounds like you are misunderstanding the 'Apply filter beneath' setting, which affects which currently logged on users the filter is applied to.

To do what you need, you'd need to do this, assuming you have a 'user' element called 'userid':

WHERE
Field: userid(raw)
CONDITION: IN
Value: SELECT id FROM jos_users WHERE gid = '21'
Type: query

Which should show you all rows submitted by users in the Publishers group.

-- hugh
 
thanks dear cheesegrits

my request not done
because all filled forms not shown for publishers

my request :

the publisher group can => "view" & "edit" all filled forms (from all user groups).

other groups (register & author & editor) only can => "view" own filled form.

i am attach a picture of my pre filter.
 

Attachments

  • image3.jpg
    image3.jpg
    16.9 KB · Views: 382
What version of Fabrik are you using? Some little bits of the following may be slightly different depending on the version, but you should be able to muddle thru regardless.

Add a User element as per Rob's original instructions. Lets call it 'userid'. Make it hidden, and set to NOT update on edit.

On your menu link (in the Joomla menu manager) you need to edit the parameters, and set the following.

Row ID: -1
Key name: userid

The row id of -1 is then treated differently by Fabrik, which replaces it with the userid of the currently logged on user.

Setting "key name" to userid forces Fabrik to then use that User element as the database key to match the userid against, rather than the primary key of the table.

Once this is done, the first time you hit that link, Fabrik should create a new table entry (row) for the form, and automatically fill in the userid field. From then on, when the same user hits that link, it should load the previously created row.

Oh, and make sure you set the Access Level on the menu link to Registered, otherwise things go hinky if guests hit it (as they all have a userid of 0).

-- hugh
For the life of me I can't find where to change Row ID to -1 .... i'm on 1.5 / 2.x. Very strange...

I looked in menu manager for the fabrik menu item that is a fabrik table type.

** Update ** i changed the menu item type to Form from Table and that brought up the Row ID box, and key field box. It works. ***
 
Need help with this.

1. name of user does not appear in username of table when viewed from administration end
2. all registered users can see the same data regardless of who entered it

What did I do wrong please?

Joomla_1.5.23 with Fabrik_2.0.4

How can I ensure users only see records created by themselves?
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
 
1. the "username" element must be of element type "user" (assuming username is your element name)
2. you can select what should be shown in table or form (e.g. Name or Username), but the UserID is stored in the database

3. in the prefilter choose
username(raw) EQUALS {$my->id}
 
troester, thanks for
the tip about username(raw)

user#1 can see his data and no one else's - good!
user#2 can see his data and no one else's - good!
administrator can see all data - good

Username displays in table - good (I like the idea of showing who added the data )

But Username shows in add form accessed by user - not good - Is it possible to prevent this from displaying in the "form"
 
Problem-plz solve it..

I m using Joomla 2.5.4 & faric 3.0
I cant ensure users only see records created by themselves. Plz help me.
 
Fabrik3 lists are fabrik1/2 tables but the principle is all the same: add a prefilter (in fabrik3 to your list)
1. the "username" element must be of element type "user" (assuming username is your element name)
2. you can select what should be shown in table (list in fabrik3) or form (e.g. Name or Username), but the UserID is stored in the database

3. in the prefilter choose
username(raw) EQUALS {$my->id}
http://fabrikar.com/forums/index.php?wiki/pre-filters/
 
Would you plz help me through TeamViewer7 software. i am quite new to joomla so unable to solve the problem. I will be grateful to you. If agreed I can send you my ID & password through skype.
 
Please read the WIKI, have a look at the forums and follow the tooltips when doing your setups in the backend.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top