We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8813
    • 18 Posts
    Hy

    I've created a page where users can join groups.
    My problem is that the $user->isMember('Mygroup') returns always false till next user's login.

    How can I flush the permission of a user easily without having to logout/login ?


    Below the code I use to test it :

    $user 	= $modx->getObject('modUser',$modx->getLoginUserID());  
       
    echo '<pre style="clear:both">';
    		print_r($user->getUserGroupNames());		
    echo '</pre>';
    		
      	
    $user->getAttributes(array(), '', true);	
        	
    echo '<pre style="clear:both">';
    		print_r($user->getUserGroupNames());		
    echo '</pre>';