Ejemplo n.º 1
0
 /**
  * Display a listing of the Role.
  *
  * @param Request $request
  * @return Response
  */
 public function index(Request $request)
 {
     $this->authorize('system.view');
     $this->roleRepository->pushCriteria(new RequestCriteria($request));
     $roles = $this->roleRepository->paginate(50);
     return view('roles.index')->with('roles', $roles);
 }
 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $page_title = trans('admin/roles/general.page.index.title');
     // "Admin | Roles";
     $page_description = trans('admin/roles/general.page.index.description');
     // "List of roles";
     $roles = $this->role->pushCriteria(new RolesWithPermissions())->pushCriteria(new RolesByNamesAscending())->paginate(10);
     return view('admin.roles.index', compact('roles', 'page_title', 'page_description'));
 }
 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     Audit::log(Auth::user()->id, trans('admin/roles/general.audit-log.category'), trans('admin/roles/general.audit-log.msg-index'));
     $page_title = trans('admin/roles/general.page.index.title');
     // "Admin | Roles";
     $page_description = trans('admin/roles/general.page.index.description');
     // "List of roles";
     $roles = $this->role->pushCriteria(new RolesWithPermissions())->pushCriteria(new RolesByNamesAscending())->paginate(10);
     return view('admin.roles.index', compact('roles', 'page_title', 'page_description'));
 }
Ejemplo n.º 4
0
 /**
  * @param Request $request
  * @return array|static[]
  */
 public function searchByName(Request $request)
 {
     $return_arr = null;
     $query = $request->input('query');
     $roles = $this->role->pushCriteria(new RolesWhereDisplayNameOrDescriptionLike($query))->all();
     foreach ($roles as $role) {
         $id = $role->id;
         $display_name = $role->display_name;
         $description = $role->description;
         $entry_arr = ['id' => $id, 'text' => "{$display_name} ({$description})"];
         $return_arr[] = $entry_arr;
     }
     return $return_arr;
 }
 /**
  * @param $id
  *
  * @return \Illuminate\View\View
  */
 public function edit($id)
 {
     $user = $this->user->find($id);
     Audit::log(Auth::user()->id, trans('admin/users/general.audit-log.category'), trans('admin/users/general.audit-log.msg-edit', ['username' => $user->username]));
     $page_title = trans('admin/users/general.page.edit.title');
     // "Admin | User | Edit";
     $page_description = trans('admin/users/general.page.edit.description', ['full_name' => $user->full_name]);
     // "Editing user";
     if (!$user->isEditable()) {
         abort(403);
     }
     $roles = $this->role->pushCriteria(new RolesByNamesAscending())->all();
     $perms = $this->perm->pushCriteria(new PermissionsByNamesAscending())->all();
     //        $roleCollection = \App\Models\Role::take(10)->get(['id', 'display_name'])->lists('display_name', 'id');
     //        $roleList = [''=>''] + $roleCollection->all();
     return view('admin.users.edit', compact('user', 'roles', 'perms', 'page_title', 'page_description'));
 }
 /**
  * @param $id
  *
  * @return \Illuminate\View\View
  */
 public function edit($id)
 {
     $user = $this->user->find($id);
     Audit::log(Auth::user()->id, trans('admin/users/general.audit-log.category'), trans('admin/users/general.audit-log.msg-edit', ['username' => $user->username]));
     $page_title = trans('admin/users/general.page.edit.title');
     // "Admin | User | Edit";
     $page_description = trans('admin/users/general.page.edit.description', ['full_name' => $user->full_name]);
     // "Editing user";
     $roles = $this->role->pushCriteria(new RolesByNamesAscending())->all();
     $perms = $this->perm->pushCriteria(new PermissionsByNamesAscending())->all();
     $themes = \Theme::getList();
     $themes = Arr::indexToAssoc($themes, true);
     $time_zones = \DateTimeZone::listIdentifiers();
     $time_zone = $user->settings()->get('time_zone', null);
     $tzKey = array_search($time_zone, $time_zones);
     $time_format = $user->settings()->get('time_format', null);
     $locales = Setting::get('app.supportedLocales');
     return view('admin.users.edit', compact('user', 'roles', 'perms', 'themes', 'time_zones', 'tzKey', 'time_format', 'locales', 'page_title', 'page_description'));
 }
Ejemplo n.º 7
0
 /**
  * @param $id
  * @return \BladeView|bool|\Illuminate\View\View
  */
 public function euEdit($id)
 {
     if (\Auth::user()->id != $id) {
         if (!\Auth::user()->hasRole(['admins', 'user-managers'])) {
             abort(403);
         }
     }
     $user = $this->user->find($id);
     $clusters = Cluster::lists('name', 'id');
     $page_title = "User | Edit";
     $page_description = trans('admin/users/general.page.edit.description', ['full_name' => $user->full_name]);
     // "Editing user";
     if (!$user->isEditable()) {
         abort(403);
     }
     $roles = $this->role->pushCriteria(new RolesByNamesAscending())->all();
     $perms = $this->perm->pushCriteria(new PermissionsByNamesAscending())->all();
     return view('user.edit', compact('user', 'clusters', 'roles', 'perms', 'page_title', 'page_description'));
 }
 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $roles = $this->role->pushCriteria(new RoleLowerOrEqualToCurrentUser($this->auth->user()))->all();
     $permissions = $this->permission->all();
     return view('roles_permissions.index', compact('roles', 'permissions'));
 }