-
☆ A M B ☆
- 450 Posts
I'm looking for a way to test whether an anonymous user meets certain criteria (based on IP address in this particular case), and, if so, grant that user rights to view certain objects that he would not otherwise have access to.
Would it be possible to have a plugin check (each time a page is requested) whether the request matches certain conditions, and if so, change the user from 'anonymous' to some other user account I've created like 'internalUser'? Or is there some way to temporarily bind the anonymous user to a certain user group?
I think it might be much simpler to just use a snippet that performed the tests and pulled in a chunk based on the results.
The chunks used could contain menus if you need different menus for different users.
It's possible to log a user in via code (though I can't remember how to do it), so another way to go would be to have the user visit a particular page where a snippet would perform the tests and log the user in without having them visit the Login page.