Recent Topics

1 Feb 09, 2006 21:30    

I'm frustrated that I can't figure this out. I've set my bloggers permissions for the most part correctly. I would like them to have access to the Blogs Tab, between Categories and Stats at the top of the Admin page and then only to change or add information to the General Tab. I don't want them to have access to Permissions or the Advanced Tabs, I want to be the only person to set them. Is this possible?

The way I have permissions set now, a blogger gets---Sorry, you have no permission to edit/view any blog's properties if they click on the Blogs Tab.

Here is how the permissions are set for all my bloggers.
Is member---is checked

Can post/edit with following statuses:
Delete posts---is checked
Edit comts---is checked
Edit cats---is checked
Edit blog---is checked
Published---is checked
Protected---is checked
Private---is checked
Draft---is checked
Deprecated---is checked

Delete Posts---is not checked
Edit Comts---is not checked
Edit Cats---is checked
Edit Blog---Is not checked

2 Feb 10, 2006 15:11

Edit Blog needs to be checked. That will give them access to all of the Blogs subtabs, including permissions and advanced. I don't know an easy way around that. It would probably involve a little bit of hacking to core files, which is never recommended. But it is possible.

3 Feb 10, 2006 20:46

What version are you running? I don't do any hackage with 1.6, but if it's .9.1 it's an easy hack to give non-admins the general tab but no others.

4 Feb 11, 2006 00:01

Thanks for your replys. I know about the edit tab and what that does and doesn't limit.

EdB, I'd really like to know more about an easy hack! My version is 0.9.0.12, can it be done with this version?

Rgs,

JJV

5 Feb 11, 2006 03:48

Take a look at admin/b2blogs.php and see if you have something like this around line 329:

			<div class="panelblocktabs">
				<ul class="tabs">
				<?php
					if( $tab == 'general' )
						echo '<li class="current">';
					else
						echo '<li>';
					echo '<a href="b2blogs.php?blog='.$blog.'&amp;action=edit">'. T_('General'). '</a></li>';

					if( $tab == 'perm' )
						echo '<li class="current">';
					else
						echo '<li>';
					echo '<a href="b2blogs.php?blog='.$blog.'&amp;action=edit&amp;tab=perm">'. T_('Permissions'). '</a></li>';

					if( $tab == 'advanced' )
						echo '<li class="current">';
					else
						echo '<li>';
					echo '<a href="b2blogs.php?blog='.$blog.'&amp;action=edit&amp;tab=advanced">'. T_('Advanced'). '</a></li>';

				?>
				</ul>
			</div>


That's the bit that makes each subtab, so you want to hide the other subtabs from visitors who aren't you. Try something like this with the 'permissions' and 'advanced' tabs:

if( $current_User->get( 'ID' ) == 1 ) {
					if( $tab == 'perm' )
						echo '<li class="current">';
					else
						echo '<li>';
					echo '<a href="b2blogs.php?blog='.$blog.'&amp;action=edit&amp;tab=perm">'. T_('Permissions'). '</a></li>';

					if( $tab == 'advanced' )
						echo '<li class="current">';
					else
						echo '<li>';
					echo '<a href="b2blogs.php?blog='.$blog.'&amp;action=edit&amp;tab=advanced">'. T_('Advanced'). '</a></li>';
}


Note the addition of two lines - an "if the current blogger is ID #1" line and a closing curly bracket line. If all goes well that will mean only the official admin will see those two tabs.

BTW this (a) is untested and (b) probably won't stop a malicious blogger from typing the appropriate stuff into their address bar and changing some params they're not supposed to change.

6 Feb 11, 2006 14:59

EdB,

You are a genius! The line number was around 650 in my file. I did what you said and voila, it's exactly what I wanted to do! I'd like to send you a Good Cooking T-shirt for your help so email me directly w/ your mailing info!

Many thanks,

JJV

7 Apr 09, 2007 15:45

I just wanted to point out more clearly (as EdB alluded) that hiding the tab isn't going to help you from a security perspective.

Myself, I want to prevent anyone from changing the media root of a blog, but generally am OK with the other settings in the Blog Settings tab. My solution was to modify ./inc/MODEL/collections/_blog.class.php

Just a one line change to make it ignore the value posted from the form, and instead always set itself to the string "default".

My small change doesn't address the needs of someone like OP.. the best solution for that would be a finer grained permissions model for this important section!


Form is loading...