I had a similar issue where I was allowing only certain staff to post to our blog, and ended up locking myself out from the front end.
I assume you're using the extended users that came in the newest update (if not, I highly recommend it! It's made things like what you're trying much easier). The superuser has a user_id of -1, and isn't part of any member groups you might create. Knowing this, however, it's easy to always allow front-end access for the superuser. If specify that restrictions only apply to situations where k_user_id > '0', then the superuser (k_user_id = -1) will always be allowed.
The sample code I've got which disables the "submit" button on the blog except for users with clearance to use it (and, clearly, the superuser).
I assume you're using the extended users that came in the newest update (if not, I highly recommend it! It's made things like what you're trying much easier). The superuser has a user_id of -1, and isn't part of any member groups you might create. Knowing this, however, it's easy to always allow front-end access for the superuser. If specify that restrictions only apply to situations where k_user_id > '0', then the superuser (k_user_id = -1) will always be allowed.
The sample code I've got which disables the "submit" button on the blog except for users with clearance to use it (and, clearly, the superuser).
- Code: Select all
<cms:pages masterpage=k_user_template id=k_user_id>
<cms:if (k_page_foldername='staff') && (k_user_id gt '0') >
<script>
$('#blogButton').prop('disabled', true);
</script>
<p class='bg-warning'>Insufficient permissions to post to the blog. Please speak with your manager if you have an idea for a blog or article.</p>
</cms:if>
</cms:pages>