• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Use viewlevel or user_id to filter view for a list

Dear All,
I would like to have your advice with following case:
I have a table named product(Id, name, descriptio,user_id).
Requirements: I would like the list to view all records of that user (edit/deleting allowed) and also records created by other users of the same access level/ view level (edit but not delete).
Please show me whether I am right or wrong with filed settings in table products? Whether it can be done with just Pre-filter options?
I am newbie to fabrikar but having great interest in fabrik
THank you very much for tour attention.
Yours very faithfully
Dang DInh Ngoc
 
Requirements: I would like the list to view all records of that user (edit/deleting allowed) and also records created by other users of the same access level/ view level (edit but not delete).

What do you mean by "the same access level / view level"?

For example, if I belong to "Registered" and "Office Staff" ... should I see all records by anyone in both Registered and Office Staff?

Or do you have a single, specific Access Level you want to restrict the test to?

-- hugh
 
What do you mean by "the same access level / view level"?

For example, if I belong to "Registered" and "Office Staff" ... should I see all records by anyone in both Registered and Office Staff?

Or do you have a single, specific Access Level you want to restrict the test to?

-- hugh
Hi Cheesgrit
Thank you very much for your post.
I have been guided by Hugh by giving a prefilter for user_id Or 1=1. This has somewhat solved my requirement but not for all the cases.
Given an Example that
I am belong to a group name FoodSafety Authority (A) and I myselft under the Board of Director(B) Of higher level than Food Safety Authority
There are also user those are producer of food(C).
So I would like: When A access they can see all things proposed by C but not B, When B log in they can see all A and C posted while C can only see what he posted.
THis is a bit complicated as I am helping farmer to register their food chain with agriculture management authority. And still stuck in this circumstances.
 
Trying to use view levels in a query is problematic, because for reasons I don't quite understand, J! decided to use a flat, JSON structure for the group / access level relationship. So instead of having a (say) #__viewlevel_group_map table, with entries like ...

level_id, group_id
2,7
2,8
3,7
3,4
3,5
etc

... they have a single #__viewlevels table with the group ids as a JSON array

id, title, ordering, rules
1,Public,0,[1]
2,Registered, 1,[6,2,8]
etc

... so the group ids are in the [6,2,8]. WHICH makes it pretty much impossible to do any direct querying of the sort you need, where you would need to join the user table, the user_usergroup_map table to the groups in a viewlevel.

So you'd probably have to do this with a PHP prefilter (type 'eval'), which returns a set of user ID's.

I have a feeling I provided someone else with a similar solution in the last year or so. Try searching the forums for getAuthorisedViewLevels, see if you come up with anything.

-- hugh
 
If you want the list of all records to be visible for a user-group you can do that at List - Access.
Likewise you can also set that records cannot be deleted, by allowing delete only to the super-user.
If you want that users can only delete their own records you can select "or use field" = UserID.
If you want to make the list also visible for other usergroups than you can set Access of list to public and use Pre-filters to exclude specific groups.
By the way you can also make an extra joomla menu of the same fabrik list where the user can see only his own products, by prefilters (WHERE UserID = {$my->id})
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top