Reply To: [Resolved] WP_DEBUG Notice for bp_setup_current_user
current_user_can() uses wp_get_current_user(). Looking at the function reference for that function, I noticed “Use the init or any subsequent action to call this function”. Take a look at the Action Reference article for the list of actions run during a typical page request. The action you use will depend on what exactly you’re doing but it looks as though the earliest available when using current_user_can() is init
Hope this helps 🙂
Ref:
https://codex.wordpress.org/Function_Reference/wp_get_current_user