Code Duplication    Length = 12-13 lines in 2 locations

includes/DataObjects/User.php 2 locations

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