Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: To filter the responses based on user group

To filter the responses based on user group 2 years 7 months ago #107560

I have a survey, that was filled from different departments of the company (sales, IT, HR, billling), is possible to allow every department manager to see only the answers that belongs to his department?
Thank you for all your hard job.
The administrator has disabled public write access.

To filter the responses based on user group 2 years 7 months ago #107579

  • c_schmitz
  • c_schmitz's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 1032
  • Thank you received: 135
  • Karma: 97
Hello Omar,

I am sorry, but this is currently not possible :-(
Best regards

Carsten Schmitz
LimeSurvey project leader
The administrator has disabled public write access.

To filter the responses based on user group 2 years 7 months ago #107580

Thank you.
I'm doing the php code modifications myself, but having issues getting the actual user group.
I'm on the page application\controllers\admin\responses.php and I'm able to get the userId by:
User::model()->findByPk(Yii::app()->session);
but can you please let me know how to get the usergroup?
The administrator has disabled public write access.

To filter the responses based on user group 2 years 7 months ago #107584

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9568
  • Thank you received: 1374
  • Karma: 390
Using Yii find all: or Yii find if you are sure user have only one group:
$oUserId= User::model()->findByPk(Yii::app()->session);
$oUserInGroup= UserInGroup::model()->find('uid= :uid',array(':uid'=>$oUserId->uid);
$oUserGroup=UserGroup::model()->find('ugid= :ugid',array(':ugid'=>$oUserInGroup->ugid);
Really bad solution, must use join here www.yiiframework.com/doc/api/1.1/CDbCommand#join%28%29
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (use private message).
The administrator has disabled public write access.
The following user(s) said Thank You: omarrodriguezt

To filter the responses based on user group 2 years 7 months ago #107620

Thank you!
The administrator has disabled public write access.

To filter the responses based on user group 2 years 4 months ago #111364

  • dweisser
  • dweisser's Avatar
  • Offline
  • Gold Lime
  • Posts: 222
  • Thank you received: 5
  • Karma: 5
I have a similar question. I am on page: application/views/admin/super/header.php.

I am able to get the user by: $tempuser= Yii::app()->session;
But I am not able to get the user group. I am only trying to return a string of the user's group. I tried the solution above, but the page breaks.

Any help would be much appreciated.
David
Last Edit: 2 years 4 months ago by dweisser.
The administrator has disabled public write access.
Time to create page: 0.217 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form