Update field Category via Query respecting flexiaccess

More
12 years 4 months ago #26387 by igcorreia
Hello, in the BEFORE SAVE FIELD function I want to change the item category via query but I notice that I was not respecting flexi access cateogry permissions, in the any easy way of CALLING the permissions/propagate function from felxi-acess? if no, from what I notice in the DB I have to add a few lines per item :/

All help is welcome. Thanks.

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #26403 by ggppdk
Which FLEXIcontent revision you have? with some latest use can use:

(even if you do not have latest grab: classes/flexicontent.categories.php should work with your revision), do not be alerted by the permission name that are like J2.5 the function is for J1.5 version
Code:
// $actions_allowed=array('core.create', 'core.edit', 'core.edit.own'); $actions_allowed = array('core.create'); // Get ids of cats with create permission, meaning user can assign item to these categories $usercats = flexicontent_cats::getFAallowedCats( $user->gmid, $actions_allowed );

with olders revisions you can use:
// Get ids of user categories with create or edit or edit.own permission
$usercats = FAccess::checkUserCats($user->gmid);


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.865 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline