Code Duplication    Length = 12-13 lines in 2 locations

includes/DataObjects/User.php 2 locations

@@ 824-836 (lines=13) @@
821
		}
822
	}
823
    
824
	public function oauthCanEdit()
825
	{
826
		try {
827
			return in_array('useoauth', $this->getOAuthIdentity()->grants)
828
				&& in_array('createeditmovepage', $this->getOAuthIdentity()->grants)
829
				&& in_array('createtalk', $this->getOAuthIdentity()->rights)
830
				&& in_array('edit', $this->getOAuthIdentity()->rights)
831
				&& in_array('writeapi', $this->getOAuthIdentity()->rights); }
832
				catch (Exception $ex) {
833
			return false;
834
		}
835
	}
836
    
837
	public function oauthCanCreateAccount()
838
	{
839
		try {
@@ 837-848 (lines=12) @@
834
		}
835
	}
836
    
837
	public function oauthCanCreateAccount()
838
	{
839
		try {
840
			return in_array('useoauth', $this->getOAuthIdentity()->grants)
841
				&& in_array('createaccount', $this->getOAuthIdentity()->grants)
842
				&& in_array('createaccount', $this->getOAuthIdentity()->rights)
843
				&& in_array('writeapi', $this->getOAuthIdentity()->rights);
844
		}
845
		catch (Exception $ex) {
846
			return false;
847
		}
848
	}
849
850
	/**
851
	 * @return bool