From 8871612131fe5e434807631697beacc97723d946 Mon Sep 17 00:00:00 2001
From: prasad <prasad@vtiger.com>
Date: Thu, 9 Jun 2016 22:16:45 +0530
Subject: [PATCH] Allow account owner of CRM to create user.

---
 modules/Users/actions/Save.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/Users/actions/Save.php b/modules/Users/actions/Save.php
index 404a530b5..fba81bfc4 100644
--- a/modules/Users/actions/Save.php
+++ b/modules/Users/actions/Save.php
@@ -21,10 +21,10 @@ class Users_Save_Action extends Vtiger_Save_Action {
 		
 		if ($allowed) {
 			// Deny access if not administrator or account-owner or self
-			if(!$currentUserModel->isAdminUser()) {
+			if(!$currentUserModel->isAdminUser() && !$recordModel->isAccountOwner()) {
 				if (empty($record)) {
 					$allowed = false;
-				} else if (!$recordModel->isAccountOwner() || ($currentUserModel->get('id') != $recordModel->getId())) {
+				} else if ($currentUserModel->get('id') != $recordModel->getId()) {
 					$allowed = false;
 				}
 			}
-- 
GitLab