Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Back end administration for users

UserPost

6:55 am
September 7, 2009


raphael_ber

Member

posts 9

1

Hi

I am using a plugin, TDO Mini Forms, to create forms that users use to create new posts. Using these forms, I wanted some custom field value to be added to the categories of the post. I could add some php code so that if the category doesn't exist, it is created and then affected to the post. If the category already exists, it is just affected to the post.

I noticed than when I was making tests as an admin, that code was working, but when I tried as a subscriber, it was not working.

After looking for long time why it was not possible for subscribers, I finally found that it was because I was using Role Scoper and that I didn't give rights to subscribers for categories.

So I added restrictions on post editor for subscribers, and applied it to all categories.

And the code could work even for subscriber. If the custom field key was "City", and the value "New York", the post category is New York.

But now, I noticed that since I added restrictions and roles on post editor, if I log in as a subscriber, in the back end, I find some tabs I don't want users to see: Posts, Media, Comments, Tools, and the tab of TDO Mini Forms.

I looked at the options of Role Scoper to see if there was a way to hide these tabs but I couldn't find how. I could block them so that if a user clicks on it, the page says: You do not have sufficient permissions to access this page. But I would like to find a way to let only the Profile tab.

If there is a way to do that, could you please tell me ?

Thank you

8:12 pm
November 12, 2009


Kevin

Admin

posts 2402

2

raphael_ber said:

Hi

But now, I noticed that since I added restrictions and roles on post editor, if I log in as a subscriber, in the back end, I find some tabs I don't want users to see: Posts, Media, Comments, Tools, and the tab of TDO Mini Forms.

… But I would like to find a way to let only the Profile tab.


I know that you granted your Subscribers your that role assignment only to allow TDO Mini Forms to add the category. But the primary meaning for most usages is that the role assignment has granted the user certain capabilities. To utilize those capabilities, corresponding menu items must be enabled. There is no RS Option to keep the menus hidden in that situation, and I have no immediate plans to develop that. I think you may be able to keep the TDO fix and have fewer new menu tabs displayed if you assign a Post Author role instead of Post Editor.

But the most complete solution I know of would come with the help of the Adminimize plugin. It includes options to deactivate any menu item, for users of any role you specify. This should be able to override Role Scoper's display of them.

8:30 pm
November 12, 2009


Kevin

Admin

posts 2402

3

Kevin said:

raphael_ber said:

Hi

But now, I noticed that since I added restrictions and roles on post editor, if I log in as a subscriber, in the back end, I find some tabs I don't want users to see: Posts, Media, Comments, Tools, and the tab of TDO Mini Forms.

… But I would like to find a way to let only the Profile tab.


I know that you granted your Subscribers your that role assignment only to allow TDO Mini Forms to add the category. But the primary meaning for most usages is that the role assignment has granted the user certain capabilities. To utilize those capabilities, corresponding menu items must be enabled. There is no RS Option to keep the menus hidden in that situation, and I have no immediate plans to develop that. I think you may be able to keep the TDO fix and have fewer new menu tabs displayed if you assign a Post Author role instead of Post Editor.

But the most complete solution I know of would come with the help of the Adminimize plugin. It includes options to deactivate any menu item, for users of any role you specify. This should be able to override Role Scoper's display of them.


Better yet, a minor Role Scoper modification should eliminate the need to assign a Category Role for Subscribers. In plugins/role-scoper/admin/filters-admin_rs.php, add the following code to the top of function flt_pre_object_terms(), just below global $current_user;

if ( did_action('tdomf_create_post_start') )
   return $selected_terms;

Let me know how it works. I will include this as a plugin conflict fix in the next RS release unless someone reports continuing problems.

4:27 am
November 17, 2009


raphael_ber

Member

posts 9

4

Hi Kevin

Thanks for your answers !

I looked for global $current_user; inside the function flt_pre_object_terms() but I couldn't find it. I'm running the version 1.0.8 of Role Scoper.

Please let me know what to try and I'll try it.

Thank you very much.

Raphael

6:21 am
November 17, 2009


Kevin

Admin

posts 2402

5

raphael_ber said:

Hi Kevin

Thanks for your answers !

I looked for global $current_user; inside the function flt_pre_object_terms() but I couldn't find it. I'm running the version 1.0.8 of Role Scoper.

Please let me know what to try and I'll try it.

Thank you very much.

Raphael


Sorry, I was looking at some newer code. In 1.0.8, you can put it just below this line:

if ( is_administrator_rs() || defined('DISABLE_QUERYFILTERS_RS') )
   return $selected_terms;

About the Agapetry forum

Currently Online:

15 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1186

Posts: 5409

Members:

There are 1176 members

There are 1 guests


Kevin has made 2402 posts

Top Posters:

metal450 - 159

Ragnar - 105

YikYak - 70

whiteorb - 44

Daisy - 35

Administrator: Kevin | Moderators: Kevin