member restrictions

Home Forums WPLMS AddOns WPLMS Batches member restrictions

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #388898
    MLP LMS
    Participant

    how can i restrict member from doing certain things.

    below here inst Zaman is instructor as member type and instructor role in the system.

    • but in batch he is moderator
    • he is still able to remove batch admin (how come)
    • he can edit courses
    • he can change / give marks status and remaks of students.


    i have changed his role to editor and author but still no change.


    how can i control member rights, restrict a certain member from doing certain things in batch, students, quizes etc.

     



    #388916
    Anshuman Sahu
    Keymaster

    if you want all mods should not be able to add members to all groups then we can do this using custom code . 

    add this code in your wplms-customizer.php file in wplms customizer plugin :


    add_filter('vibebp_groups_api_can_add_members',function($x,$group_id,$user_id){
    $admins = groups_get_group_admins($group_id);
    		if(!empty($admins)){
    			foreach ($admins as $key => $mod) {
    				if($mod->user_id==$user_id){
    					break;
    					return true;
    					
    					
    				}
    			}
    		}
    	return false;

    },10,3);
    #389051
    MLP LMS
    Participant

    can you guide the route for the file wherein this code is to be embeded.

    #389073
    Anshuman Sahu
    Keymaster

    Please download and install this plugin : https://wplms.io/support/wp-content/uploads/2023/08/wplms-customizer.zip


    then in wp-admin -> plugins ->plugins editor -> select wplms customizer plugin to edit -> in the wplms-customizer.php file add the code in the end and update the changes.

    #389106
    MLP LMS
    Participant

    thank you this code works


    further how can i enable / disbale option for moderator 

    1- to create groups

    2- as well as to invite members well.

     


    #389147
    Anshuman Sahu
    Keymaster

    Please goto wp-admin -> settings -> buddypress-> options > "  Group Creation " disable this option .


    add this code in your wplms-customizer.php file in wplms customizer plugin :

    add_filter('vibebp_groups_api_can_invite',function($x,$group_id,$user_id){
    $admins = groups_get_group_admins($group_id);
    if(!empty($admins)){
    foreach ($admins as $key => $mod) {
    if($mod->user_id==$user_id){
    break;
    return true;


    }
    }
    }
    return false;

    },10,3);
    #389211
    MLP LMS
    Participant

    Hi

    i have tried this code this doesnt work for a an instructor who is also moderator of in some group.

    but if i have changed a group moderator default role from instructor to parents then it does work.


    response is awaited

    #389243
    Anshuman Sahu
    Keymaster

    Hi this code allows only admin of the group to invite the user and it excludes moderator and its working fine at my end.

    or the group creation part . 

    did you :  goto wp-admin -> settings -> buddypress-> options > ”  Group Creation ” disable this option ?


    please share site url , instructor creds , admin creds to check these at your end.

    #389301
    MLP LMS
    Participant

    yes the BP settings are set same

    here are creds

    https://wplms.ticksy.com/ticket/3448492

    #389321
    Anshuman Sahu
    Keymaster

    I tested this and the code I provided is working fine .

    https://somup.com/c0jvIpAxvw

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.