[SOLVED] Auto Action - generate a "notification/message " on the page

4 years 2 months ago #316619 by krileon
None of that really has anything to do with CB. We have no control over Joomlas authorization process. CB can't even override that. The only way for CB to control access like that, and is how CBSubs does it, is by making the content public and doing your own custom authorization checks after Joomlas routing event before it displays the content. If this is strictly for Joomla articles then the below event is probably the easiest way to add this.

docs.joomla.org/Special:MyLanguage/Plugin/Events/Content#onContentBeforeDisplay

To act on it in CB Auto Actions for example you'd use joomla_onContentBeforeDisplay. That event I believe is fired after the message queue has already processed so what you're doing to test events won't display anything.

Don't understand why you want to dynamically modify their usergroups like that. They should just have all the access they permitted to have from the beginning then restrict your content accordingly so they can only see what they've access to. If you need this usergroups migration check ran regularly I recommend just doing it on every login.


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.

4 years 2 months ago - 4 years 2 months ago #316628 by smalldragoon
hi,
Yes You already explained in my 1st 1st post and I understand that CB can not deal with authorozations.no problems.
now, the way to "give access" or not to an article / module /whatsoever is the fact belong to a group ( or not )
I can not use a regulary check of the belonging of a group. I need to do it each time a user click on a "ressource".
The fact to modify dynamically the groups allows the equivalent of group belonging.
let's put aside my previous full explanation and focus on CB features / capabilities :

1 - user click on a ressource ( article / module / whatsoever )
2 - an auto-action is trigered based on1
3 - auto action check groups belonging
4 - based on an external update , groups are updated
5 - from my understandind, it requires user reload
6 - user access the ressource ( or not )

So,I'm sure CB cando the dynamic assignement ofgroups ( already did this, with a more simple usecase ). I have my updated list of group available in session variable as exemple . now the question is how to get the auto-action triggered ? what is the best option / is your suggested previous joomla event is not good finally ?
thx

Please Log in to join the conversation.

4 years 2 months ago #316642 by krileon

1 - user click on a ressource ( article / module / whatsoever )
2 - an auto-action is trigered based on1
3 - auto action check groups belonging
4 - based on an external update , groups are updated
5 - from my understandind, it requires user reload
6 - user access the ressource ( or not )

The earliest you'll be able to act is during the routing process. So you'd have to use onAfterRoute event. It's a Joomla event so it must be prefixed with joomla_onAfterRoute. You also need to ensure CB Auto Actions system plugin in Extensions > Plugins is published and public as it's responsible for loading Joomla auto actions. That event has no user object so you'd need something like the below for the initial setup.

Triggers: joomla_onAfterRoute
User: Self
Access: Everybody

That could be too early though so you can also give joomla_onBeforeRender a try, but am unsure if access checks have already been applied by then so it may not work.

Beyond that I don't know what more to suggest. Your usecase just doesn't make any sense. There should be no need for swapping usergroups on the minute like that. Normally you'd just do something like that after a user logs in instead of on every single page view, which is likely to degrade every pages performance.


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.

4 years 2 months ago #316649 by smalldragoon
Thanks Krileon,
The trick was that I did not have the plugin enabled in the general plugins.
Regarding now : "Your usecase just doesn't make any sense", without explaning you my entire usecase which will be very specific to myself, I can give you many examples , like the "sudo" command as exemple, which require elevation of priviledges for just one command and goes back to previous level ( or after a short period).
Another exemple is on a bank account where you want to make a transfer : above a trigger amount, you need a new auth to be granted to perform the wire transfer or an amunt of time.
The usage of the groups will fullfill this requirement : if authenticated correctly, I will give the belonging to the group for 1 action ( or more ) and/or a time period. Then, I will downgrade the user to his "non priviledged" level. Make sense for you now ?
Thx

Please Log in to join the conversation.

4 years 2 months ago #316660 by krileon
I see, I understand your usecase now. Glad it's working now. Please feel free to post new topics in the professional support forums if you should have any further questions or issues.


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.
The following user(s) said Thank You: smalldragoon

Please Log in to join the conversation.

4 years 2 months ago #316710 by smalldragoon
Thanks a lot !
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.226 seconds

Facebook Twitter LinkedIn