Forum Replies Created
-
AuthorPosts
-
August 19, 2015 at 11:14 pm in reply to: Role needs to permit View and Use of Library Media – But NOT Add New Media #14775Syam MohanKeymaster
Hi Steve,
Does the code work?
Thanks
Syam
Syam MohanKeymasterHi Bratt,
Does the code work?
Thanks
Syam
Syam MohanKeymasterThis history is posted here to give a context to the review written on wordpress.org.
Syam MohanKeymasterHi Ian,
I don’t think I understand your first question. Where do you see the “Domain Mapping” menu? Within the network admin or on individual site admin?
You can remove Roles capabilities and Roles won’t appear.
Syncing menus is difficult, because each site can have it’s own menu setup and at this point there is no way to figure it out from the network admin.
Thanks
Syam
Syam MohanKeymasterHi Bratt,
The reason it was not working because its too late to redirect from a page template.
function login_page_template_redirect() { if(is_page('login')) { if(is_user_logged_in()) { wp_redirect(apply_filters('login_redirect', '/')); } else { wp_redirect('/wp-login.php'); } exit(); } } add_action( 'template_redirect', 'login_page_template_redirect' );
Try putting the above code within the functions.php.
Thanks
Syam
Syam MohanKeymasterIn your scenario, your role need “read” capability and all the capabilities under “Projects” except publish. Now with “edit_projects” capability user will be able to create new Projects, but they won’t be able to publish. They can submit it for review.
Now to give only access to Project X, you will have to use Extended Permissions. Using Bulk Edit remove Read/Edit/Delete permission on all Projects for the role. Then edit Project X enable Read/Edit/Delete for the role.
That configuration should achieve what you are looking for.
Now to give same permission on Project Y, edit extended permission of Project Y. But if you want to give same permission on a different project for different set of users, then you will have to create a new role and repeat the process.
Thanks
Syam
Syam MohanKeymasterHi Remix,
To create the roles with right permissions, you need to know what all capabilities are required to handle products and manage Woocommerece. I’m not familiar with Woocommerece. Is it possible for you to ask within the Woocommerece support, what all capabilities are required to manage the functionalities you are looking for?
Thanks
Syam
Syam MohanKeymasterYou are welcome Remix.
Syam MohanKeymasterHi Remix,
I have configured your site the way you want. I created a new role “Test”.
Take a look into
1. Capabilities for Test
2. Menu Editor for Test
3. Login Redirect for TestThese are the minimum configuration required.
Thanks
Syam
Syam MohanKeymasterHi Bratt,
It seems like the caching is still there. I’ll try to do the code on one of my development sites and send it you. It will take me sometime, since I need to setup the testing environment.
Thanks
Syam
August 12, 2015 at 6:16 pm in reply to: Role needs to permit View and Use of Library Media – But NOT Add New Media #14317Syam MohanKeymasterfunction wpfront_custom_upload_prefilter( $file ) { $roles_not_allowed = array('author', 'editor'); //not allowed role names $user = wp_get_current_user(); foreach($roles_not_allowed as $role) { if(in_array($role, $user->roles)) { $file['error'] = 'You are not allowed to upload.'; return $file; } } return $file; } add_filter( 'wp_handle_upload_prefilter', 'wpfront_custom_upload_prefilter' );
The above code limits any user who belongs to Author or Editor from uploading. Make sure to change the role names to your role names.
Thanks
Syam
Syam MohanKeymasterHi Michael,
If there is no specific criteria and it has to be set manually then you will have create as many roles based on how many set of permissions you have. For example if half the users get access to same project and half of them don’t then you need two roles. Or if one third of the users get access to Project A, another one third get access to Project B and no one get access to Project C, then you need three roles.
You can set the permission through bulk edit, but you still have to create as many roles against each permission set.
I believe that “Edit Page” link is coming from bbPress and allows you to edit the original topic. I will try to find a way to remove it. For now it will be there but no one will be able to use it. Thanks for reporting it.
Syam
Syam MohanKeymasterHi Remix,
Make sure the new role has “read” capability.
You could also use login redirect to take them to the right dashboard page.
Thanks
Syam
Syam MohanKeymasterAre you hosting on a shared server or VPS?
I’ll give it another try since you disabled Wordfence.
Thanks
Syam MohanKeymasterHi Michael,
What is your criteria for associating a project to a user/role?
From where did you get the above edit link? That is a wp-admin post edit link and users are not allowed to access wp-admin on wpfront.com for security reasons, hence you get redirected to front end.
Sorry for the delayed response, I didn’t get a notification on this topic creation.
Thanks
Syam
-
AuthorPosts