/**
  * Lists all Assignment models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PersonsGroupSearch();
     $dataProvider = $searchModel->search(\Yii::$app->request->getQueryParams());
     /*
     $authManager = Yii::$app->authManager;
     $roles = $authManager->getRoles();
     $permissions = $authManager->getPermissions();
     $assigned = [];
     
     foreach ($authManager->getAssignments($id) as $assigment) {
         if (isset($roles[$assigment->roleName])) {
             if (empty($term) || strpos($assigment->roleName, $term) !== false) {
                 $assigned['Roles'][$assigment->roleName] = $assigment->roleName;
             }
             unset($roles[$assigment->roleName]);
         } elseif (isset($permissions[$assigment->roleName]) && $assigment->roleName[0] != '/') {
             if (empty($term) || strpos($assigment->roleName, $term) !== false) {
                 $assigned['Permissions'][$assigment->roleName] = $assigment->roleName;
             }
             unset($permissions[$assigment->roleName]);
         }
     }
     */
     return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
 }
예제 #2
0
 /**
  * Lists all PersonsGroupRecord models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new PersonsGroupSearch();
     //        $searchModel->Deleted = 0;
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     Url::remember('', 'actions-redirect');
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }