Skip to content
Snippets Groups Projects
Commit 2162a493 authored by Prasad's avatar Prasad
Browse files

Merge branch '39741581_Security_list_All_Users' into 'master'

##39741581::Uma::security list all users

See merge request !358
parents cd8bebf3 7a612100
No related branches found
No related tags found
No related merge requests found
......@@ -66,15 +66,22 @@ class Users_ListView_Model extends Vtiger_ListView_Model {
* @return string
*/
public function getQuery() {
$listQuery = parent::getQuery();
$searchKey = $this->get('search_key');
if(!empty($searchKey)) {
$listQueryComponents = explode(" WHERE vtiger_users.status='Active' AND", $listQuery);
$listQuery = implode(' WHERE ', $listQueryComponents);
}
$listQuery .= " AND (vtiger_users.user_name != 'admin' OR vtiger_users.is_owner = 1)";
return $listQuery;
$listQuery = parent::getQuery();
$searchKey = $this->get('search_key');
if(!empty($searchKey)) {
$listQueryComponents = explode(" WHERE vtiger_users.status='Active' AND", $listQuery);
$listQuery = implode(' WHERE ', $listQueryComponents);
}
$listQuery .= " AND (vtiger_users.user_name != 'admin' OR vtiger_users.is_owner = 1)";
// Impose non-admin restrictions.
$user = vglobal('current_user');
if(!is_admin($user)){
$listQuery .= " AND vtiger_users.id = {$user->id}";
//TODO: Consider user based on Role-heirarchy
}
return $listQuery;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment