当前位置: 首页>>代码示例>>PHP>>正文


PHP Roles::all方法代码示例

本文整理汇总了PHP中Roles::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::all方法的具体用法?PHP Roles::all怎么用?PHP Roles::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Roles的用法示例。


在下文中一共展示了Roles::all方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: userInfo

 /**
  * [userApproval get user information]
  * @param  [integer] $id [user id]
  * @return [array]     [user information]
  */
 public function userInfo($id)
 {
     $nhcuser = new Usernhc();
     $datas = $nhcuser->getUsernhcById($id);
     $role = Roles::all();
     $ur = new RoleUser();
     $role_user = $ur->getRoleById($id);
     return View::make('userlist.approval')->with('user_result', $datas[0])->with('role_data', $role)->with('role_user', $role_user)->with('usertype', $this->usertype)->with('acive_status', $this->acive_status);
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:14,代码来源:UsernhcController.php

示例2: run

 public function run()
 {
     // se crean todos los roles del sistema
     $arr_roles = array(array('code' => '1', 'name' => 'Ver Clientes'), array('code' => '1.1', 'name' => 'Crear Clientes'), array('code' => '1.2', 'name' => 'Editar Clientes'), array('code' => '1.3', 'name' => 'Eliminar Clientes'), array('code' => '2', 'name' => 'Ver Categoria'), array('code' => '2.1', 'name' => 'Crear Categoria'), array('code' => '2.2', 'name' => 'Editar Categoria'), array('code' => '2.3', 'name' => 'Eliminar Categoria'), array('code' => '3', 'name' => 'Ver Sub Categoria'), array('code' => '3.1', 'name' => 'Crear Sub Categoria'), array('code' => '3.2', 'name' => 'Editar Sub Categoria'), array('code' => '3.3', 'name' => 'Eliminar Sub Categoria'), array('code' => '4', 'name' => 'Ver Productos'), array('code' => '4.1', 'name' => 'Crear Productos'), array('code' => '4.2', 'name' => 'Editar Productos'), array('code' => '4.3', 'name' => 'Eliminar Productos'));
     $db_roles = Roles::all()->toArray();
     for ($i = 0; $i < count($arr_roles); $i++) {
         $inser = true;
         for ($j = 0; $j < count($db_roles); $j++) {
             if ($arr_roles[$i]['code'] == $db_roles[$j]['code']) {
                 $inser = false;
             }
         }
         if ($inser) {
             Roles::create($arr_roles[$i]);
         }
     }
 }
开发者ID:alexlondon07,项目名称:cms_laravel_4.2,代码行数:17,代码来源:RolesTableSeeder.php

示例3: getReport

 public function getReport()
 {
     // $purp = new Purpose();
     // $per_page = Config::get('nhc/site.perpage') ;
     // $purpose = $purp->getAllPurpose($per_page);
     $allDataName = Data::all(array('id', 'data_name'))->toArray();
     foreach ($allDataName as $key => $value) {
         $arr_data[$key]['id'] = 'data_' . $value['id'];
         $arr_data[$key]['name'] = $value['data_name'];
     }
     $allRoleName = Roles::all(array('id', 'role_name'))->toArray();
     foreach ($allRoleName as $key => $value) {
         $arr_role[$key]['id'] = 'role_' . $value['id'];
         $arr_role[$key]['name'] = $value['role_name'];
     }
     $supportData = array_merge($arr_role, $arr_data);
     return View::make('report.report')->with('listbox', $supportData);
     //->with('paginator',$purpose);
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:19,代码来源:ReportController.php

示例4: policyRBACEditFrmAction

 /**
  * [policyRBACEditFrmAction Show form for edit rbac-policy]
  * @param  [integer] $id policy id
  * @return [none] redirect to view
  */
 public function policyRBACEditFrmAction($id)
 {
     $data['policy'] = Policy::find($id);
     $data['role'] = Roles::all();
     $data['data'] = Data::all();
     $data['condition'] = Condition::all();
     $data['action'] = Action::all();
     $data['purpose'] = Purpose::all();
     $data['obligation'] = Obligation::all();
     // print '<pre>';
     // print_r(self::policyRBACEditAction($id));
     // exit();
     return View::make('rbac.editrbac')->with('results', $data)->with('rbac_data', self::policyRBACEditAction($id));
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:19,代码来源:PolicyController.php

示例5: peerRoleFrm

 /**
  * [peerRoleFrm show form peer's role use ajax]
  * @return [type] [description]
  */
 public function peerRoleFrm()
 {
     return View::make('peer.rolelist')->with('all_role', Roles::all());
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:8,代码来源:PeerController.php

示例6: usageAction

 public function usageAction()
 {
     $roleObj = Roles::all();
     $dataObj = Data::all();
     return View::make('usage.usage');
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:6,代码来源:UsageController.php

示例7: roleReport

 /**
  * [roleReport description]
  * @param  string $roleid   [description]
  * @param  string $flag [description]
  * @param  string $type [description]
  * @return [type]       [description]
  */
 public function roleReport($roleid = "", $flag = "", $type = "")
 {
     $training = new UserTraining();
     if ($roleid == '') {
         $roles = Roles::all();
         //var_dump($roles[0]);exit;
         return View::make('train.reportrole')->with('rs', $roles);
     } else {
         if ($roleid != '' and $flag == '') {
             $rs = $training->getUserTrainByRoleId($roleid);
             // var_dump($rs);exit;
             return View::make('train.reportrole_ajax')->with('rs', $rs)->with('role_id', $roleid);
         } else {
             $role_obj = new Roles();
             $this->rolename = $role_obj->getRoleName($roleid)->role_name;
             $rs = $training->getUserTrainByRoleId($roleid);
             $this->exportXls($rs, $type);
         }
     }
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:27,代码来源:TrainingController.php

示例8: makeProfile

 public static function makeProfile($title)
 {
     $assigned_roles = array();
     $roles = Roles::all()->toArray();
     switch ($title) {
         case 'super_admin':
             //Acceder al modulo de clientes
             $assigned_roles[] = User::getIdFromRoles($roles, '1');
             //Crear clientes
             $assigned_roles[] = User::getIdFromRoles($roles, '1.1');
             //Editar clientes
             $assigned_roles[] = User::getIdFromRoles($roles, '1.2');
             //Eliminar clientes
             $assigned_roles[] = User::getIdFromRoles($roles, '1.3');
             //Acceder al modulo de usuarios
             $assigned_roles[] = User::getIdFromRoles($roles, '2');
             //Crear usuarios
             $assigned_roles[] = User::getIdFromRoles($roles, '2.1');
             //Editar usuarios
             $assigned_roles[] = User::getIdFromRoles($roles, '2.2');
             //Eliminar usuarios
             $assigned_roles[] = User::getIdFromRoles($roles, '2.3');
             //Acceder al modulo de proveedores
             $assigned_roles[] = User::getIdFromRoles($roles, '3');
             //Crear proveedores
             $assigned_roles[] = User::getIdFromRoles($roles, '3.1');
             //Editar proveedore
             $assigned_roles[] = User::getIdFromRoles($roles, '3.2');
             //Eliminar proveedores
             $assigned_roles[] = User::getIdFromRoles($roles, '3.3');
             //costos
             $assigned_roles[] = User::getIdFromRoles($roles, '4');
             $assigned_roles[] = User::getIdFromRoles($roles, '4.1');
             $assigned_roles[] = User::getIdFromRoles($roles, '4.2');
             $assigned_roles[] = User::getIdFromRoles($roles, '4.3');
             //Cateoria
             $assigned_roles[] = User::getIdFromRoles($roles, '5');
             $assigned_roles[] = User::getIdFromRoles($roles, '5.1');
             $assigned_roles[] = User::getIdFromRoles($roles, '5.2');
             $assigned_roles[] = User::getIdFromRoles($roles, '5.3');
             //Productos
             $assigned_roles[] = User::getIdFromRoles($roles, '6');
             $assigned_roles[] = User::getIdFromRoles($roles, '6.1');
             $assigned_roles[] = User::getIdFromRoles($roles, '6.2');
             $assigned_roles[] = User::getIdFromRoles($roles, '6.3');
             // //Marcos
             // $assigned_roles[] = User::getIdFromRoles($roles, '7');
             // $assigned_roles[] = User::getIdFromRoles($roles, '7.1');
             // $assigned_roles[] = User::getIdFromRoles($roles, '7.2');
             // $assigned_roles[] = User::getIdFromRoles($roles, '7.3');
             // // Tinta Mezcla
             // $assigned_roles[] = User::getIdFromRoles($roles, '8');
             // $assigned_roles[] = User::getIdFromRoles($roles, '8.1');
             // $assigned_roles[] = User::getIdFromRoles($roles, '8.2');
             // $assigned_roles[] = User::getIdFromRoles($roles, '8.3');
             // // Referencias
             // $assigned_roles[] = User::getIdFromRoles($roles, '9');
             // $assigned_roles[] = User::getIdFromRoles($roles, '9.1');
             // $assigned_roles[] = User::getIdFromRoles($roles, '9.2');
             // $assigned_roles[] = User::getIdFromRoles($roles, '9.3');
             // // Kit
             // $assigned_roles[] = User::getIdFromRoles($roles, '10');
             // $assigned_roles[] = User::getIdFromRoles($roles, '10.1');
             // $assigned_roles[] = User::getIdFromRoles($roles, '10.2');
             // $assigned_roles[] = User::getIdFromRoles($roles, '10.3');
             // // Pedidos
             // $assigned_roles[] = User::getIdFromRoles($roles, '11');
             // $assigned_roles[] = User::getIdFromRoles($roles, '11.1');
             // $assigned_roles[] = User::getIdFromRoles($roles, '11.2');
             // $assigned_roles[] = User::getIdFromRoles($roles, '11.3');
             // // Ordenes
             // $assigned_roles[] = User::getIdFromRoles($roles, '12');
             // $assigned_roles[] = User::getIdFromRoles($roles, '12.1');
             // $assigned_roles[] = User::getIdFromRoles($roles, '12.2');
             // $assigned_roles[] = User::getIdFromRoles($roles, '12.3');
             break;
         case 'supervisor':
             $assigned_roles[] = User::getIdFromRoles($roles, '10');
             break;
         case 'operario':
             $assigned_roles[] = User::getIdFromRoles($roles, '11');
             break;
     }
     // print_r($assigned_roles); die();
     return $assigned_roles;
 }
开发者ID:alexlondon07,项目名称:accounting,代码行数:86,代码来源:User.php


注:本文中的Roles::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。