How to set up users to view and modify only their own entries?

I have one list viewed by 4 different groups (Joomla Acl). I used the pre-filter of the menu to filter the list so that each group has a different display.

Group 1 users can only view filtered elements of all the entries of the list
Group 2 users can view, add and edit only their own entries.
Group 3 users can view filtered elements of all the entries of the list and can modify only one field
Group 4 users can view, add and modify any elements of all the entries

So how can I set up the menu pre-filter so that group 2 users can view and edit only their own entries knowing that those users are also members of group 1?

Joomla 3.3.3
Template protostar
php 5.4.32
MySQL 5.5.39.36.0

I'm not a rocket in php. Please easy guidance will be very much appreciated.

Thank you
 
For "users can view, add and edit only their own entries." see http://fabrikar.com/forums/index.php?wiki/pre-filters/#show-records-belonging-to-the-logged-on-user

The combination of different prefilters, list access settings, element access settings depends heavyly on your Joomla ACL settings (which usergroups, which accesslevels assigned to the groups...)
If it is to complicated you may also copy your list and assign different access levels to this list, elements etc.

Keep in mind that a menu prefilter is never a security means (the user can overcome it by just deleting itemid=X from the URL), so the strongest prefilter must be defined in the list setting.
 
Great! Group 2 users can now see their own entries. However, they can also see and modify entries of Group 4 once old or new entries of the list are modified or added by Group 4 members :( . Below is how I set it up:
I copied the list and assigned different access levels to this list
I applied the pre-filter rule:
AND
where:
field = your-user-element(raw)
condition: equals
value: {$my->id}
type=text
applying to group 2

and a second rule to allow Group4 to see all entries. Members of Group 4 are also members of group 2.
OR
where:
field = your-user-element(raw)
condition: greater or equals
value: 0
type=text
applying to Group 4

so I really don't know where I did it wrong. Please help.

Thank you
 
It depends on your group and access levels settings in Joomla users.
Groups are inheriting the access levels of their parent group.

So if group4 is parent of group2 and group4 has access level group4
then group2 has access level group4, too.
This is Joomla ACL, nothing to do with Fabrik.

Prefilters are using access levels, not groups.
 
Group 2 is parent of public and group 4 too. Please below is how I set up the access levels and groups
Group2= sales
Group4= rockadmin
Group4 users belong to group 2 too but Group 2 users don't belong to group4 and both have different access level.
All elements of this list have group 2 access level.
 

Attachments

  • access_level.png
    access_level.png
    20.8 KB · Views: 477
  • user_group.png
    user_group.png
    30.5 KB · Views: 483
  • sales_users_access_level.png
    sales_users_access_level.png
    62.2 KB · Views: 493
  • rockadmin_users_permissions.png
    rockadmin_users_permissions.png
    66 KB · Views: 476
Hello,

I still did not resolve the issue. I would like that Group 2 with access level group 2 only views adds and edits his own records. Group 4 with level access 2 and 4 should view and edit all the records. Group2 and 4 are not parent. They both are set under public.
Thank you for your assistance
 
You are talking about group 2 and group 4 etc, but then all the images of your actual settings don't mention Group 2 or Group 4 ... so it's kind of impossible for us to help.

Please try and give us a description of what you are trying to achieve, where the names you use in your description match the names in the screenshots of your settings.

-- hugh
 
Thank you for coming back to me and sorry for being not limpid enough. I thought I did explain it when I specified it in my previous post as follow: group2= sales and group4= rockadmin.

So, I would like that "sales" users only see and edit their own records and rockadmin users can see and edit all the records from a starting point.
I have left joined the "user" table to the copied "orders"table and applied the following pre-filters:

AND
where:
field = your-user-element(raw)
condition: equals
value: {$my->id}
type=text
applying to group sales

and a second rule to allow Group rockadmin to see and edit only all entries that group sales recorded. Members of Group rockadmin are also members of group sales.
OR
where:
field = your-user-element(raw)
condition: greater or equals
value: 0
type=text
applying to Group rockadmin

Currently, I think I have managed the first part (still checking...) but the second part is not satisfactory as rockadmin users view all the records of this table and not only the records entered by sales users.

Thank you for your assistance
 
JAccess::getUsersByGroup(2);
will give you an array with all user_ids belonging to group2 (replace 2 with your sales group id)

So it should be possible to do in the 2nd prefilter something like (I didn't test, so turn error reporting on and enable the var_dump)

Where your-user-element(raw) IN

$uids = JAccess::getUsersByGroup(2);
$uidstring = '('.implode(',',$uids).')';
//var_dump($uidstring);exit;
return $uidstring;

Type eval
 
ok I tried it with no success. From the menu, I applied the second prefilter as follows:
OR

Where your-user-element(raw) IN
$uids = JAccess::getUsersByGroup(14);
$uidstring = '('.implode(',',$uids).')';
//var_dump($uidstring);exit;
return $uidstring;

Type eval

I still have the same view, rockadmin users are still seeing only the records they personally entered.
Here is the direct link to the error report screenshot http://awesomescreenshot.com/07640rr14b
 
Did you enable the var_dump line to see what you get (or if it's running at all)?
You should see an empty page with some string... information.

Additionally (with var_dump commented out) enable Fabrik debug (in Fabrik options) (not Joomla debug) and append &fabrikdebug=1 to your list url to check the generated query.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top