Welcome, Guest
Username: Password: Remember me

TOPIC: To filter the responses based on user group

To filter the responses based on user group 5 months 1 week 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 5 months 1 week ago #107579

  • c_schmitz
  • c_schmitz's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 787
  • Thank you received: 113
  • Karma: 92
Hello Omar,

I am sorry, but this is currently not possible :-(
Support us, too. Donate to the LimeSurvey project and help keep us going!
The administrator has disabled public write access.

To filter the responses based on user group 5 months 1 week 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 5 months 6 days ago #107584

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6338
  • Thank you received: 819
  • Karma: 243
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
The administrator has disabled public write access.
The following user(s) said Thank You: omarrodriguezt

To filter the responses based on user group 5 months 6 days ago #107620

Thank you!
The administrator has disabled public write access.

To filter the responses based on user group 1 month 3 weeks ago #111364

  • dweisser
  • dweisser's Avatar
  • OFFLINE
  • Bronze Donor
  • Posts: 204
  • 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: 1 month 3 weeks ago by dweisser.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.172 seconds
Donation Image