CB Blogs K2 integration does not respect K2 groups authorization

3 years 9 months ago - 3 years 9 months ago #319008 by activha
Hello

It seems like the k2 integration in CB Blogs with the selection of categories within CB Blogs does not respect any longer the belonging of the user to a K2 group or not.

For instance with two user groups in k2 U1 and U2 with categories C1U1, C2U1 available for first one and C3U2, C4U2 available for the second one, and all four categories under a main one CAT
If we choose CAT as main category in CB Blogs, then all CB users have access to all 4 sub categories whether they are in k2 U1 group or in k2 U2 group or not in k2 groups.

CB users are correctly registered in U1 or U2 groups according to their CBSubs plan active or not by an autoaction (which works fine)

Mind to confirm from your side ?
Is this new ?

Please Log in to join the conversation.

3 years 9 months ago #319013 by krileon
The implementation on our end is unchanged. We're still calling the same API CB Blogs has always called. Specifically we're doing the below.

$categories	=	new K2ModelCategories();
$cache		=	$categories->categoriesTree( null, true, true );

Unless the behavior of categoriesTree has changed I assume it should work as it always has.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 9 months ago #319051 by activha
It seems like this API calls the categories correctly but am not sure that it has an impact on the authorizations given to a K2 user to publish in categories.

We had noticed the issue since years but it had no real impact on our processes up to now.

Please Log in to join the conversation.

3 years 9 months ago #319056 by krileon
Unless they've a different API function that I'm not aware of I don't know what to suggest. I assume that API should return the appropriate categories visible to that user.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 9 months ago #319102 by activha
this is the answer from K2 team

These are backend model calls.

If your customized code runs in the frontend, you need to call the model with the right context if you use the Joomla API or just require the file using its full path.

See how the "categoriesTree" method is used here: github.com/getk2/k2/search?q=categoriesTree&unscoped_q=categoriesTree

Please Log in to join the conversation.

3 years 9 months ago #319107 by krileon
Their API is unclear. K2ModelCategories->categoriesTree is the only category output that provides HTML ready for select options, but it does not check access. K2ModelItemlist->getCategoriesTree checks access, but is not HTML ready for select options. I don't know what API they're expecting me to use here and if I need to be processing the results into HTML ready select options or not myself.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.214 seconds

Facebook Twitter LinkedIn