/**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getCreate(Request $request)
 {
     // Get all the available permissions
     $permissions = $this->permission->all();
     // Selected permissions
     $selectedPermissions = $request->old('permissions', array());
     // Title
     $title = 'Create role';
     // Show the page
     return view('core.admin.roles.create', compact('permissions', 'selectedPermissions', 'title'));
 }
Beispiel #2
0
 /**
  * Checking if the given user can reference the given uri.
  *
  * @param $user
  * @param $uri
  * @return bool
  */
 public function canRefence($user, $uri)
 {
     $permissions = $this->permission->all();
     foreach ($permissions as $permission) {
         if ($user->can($permission->name)) {
             $routes = $this->permissionRoute->where('permission_id', '=', $permission->id)->get();
             foreach ($routes as $route) {
                 if ($route->route == $uri) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
Beispiel #3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $role = Role::findOrFail($id);
     $permissions = Role::findOrFail($id)->permissions()->get();
     $all_permissions = Permission::all();
     return view('pages.admin_pages.role')->with('role', $role)->with('all_permissions', $all_permissions)->with('permissions', $permissions);
 }
Beispiel #4
0
 /**
  * edit data page
  * @param int id
  * @return view
  */
 public function edit($id)
 {
     $role = Role::findOrFail($id);
     $role_permission = DB::table('permission_role')->where('role_id', $id)->select('permission_id')->get();
     $permission = Permission::all(['id', 'name']);
     return view('admin.role.edit', compact('role', 'role_permission', 'permission'));
 }
Beispiel #5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Role::create(['name' => 'manager_receive', 'label' => 'Manager of Receive.']);
     Role::create(['name' => 'manager_requesition', 'label' => 'Manager of Requesition.']);
     Role::create(['name' => 'manager_product_list', 'label' => 'Manager of Product list.']);
     Role::create(['name' => 'manager_product', 'label' => 'Manager of Product.']);
     Role::create(['name' => 'manager_product_type', 'label' => 'Manager of Product Type.']);
     Role::create(['name' => 'manager_unit', 'label' => 'Manager of Unit.']);
     Role::create(['name' => 'manager_location', 'label' => 'Manager of Location.']);
     Role::create(['name' => 'manager_project', 'label' => 'Manager of Project.']);
     Role::create(['name' => 'manager_user', 'label' => 'Manager of User.']);
     Permission::create(['name' => 'create_form', 'label' => 'Create of form.']);
     Permission::create(['name' => 'update_form', 'label' => 'Update of form.']);
     Permission::create(['name' => 'delete_form', 'label' => 'Delete of form.']);
     $roles = Role::all();
     $permissions = Permission::all();
     foreach ($roles as $role) {
         foreach ($permissions as $permission) {
             $role->givePermissionTo($permission);
         }
     }
     $user = User::whereEmail('*****@*****.**')->first();
     foreach ($roles as $role) {
         $user->assignRole($role->name);
     }
     $user = User::whereEmail('*****@*****.**')->first();
     foreach ($roles as $role) {
         $user->assignRole($role->name);
     }
 }
 /**
  * Table of all roles and their permissions
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $roles = Role::all();
     $permissions = Permission::all();
     $routes = PermissionRoute::select('route', 'id', 'permission_id')->get();
     return view('rbac-gui.roles_permissions.index', compact('roles', 'permissions', 'routes'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $usergroup = \App\Usergroup::findOrFail($id);
     $permissions = \App\Permission::all();
     return view('usergroups.edit', compact('usergroup', 'permissions'));
 }
Beispiel #8
0
 public static function permissions($type = null, $data = null)
 {
     if ($type and $data) {
         return Permission::where($type, $data)->get();
     }
     return Permission::all();
 }
Beispiel #9
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $permissions = Permission::all();
     $role = Role::find($id);
     $permission_role = $role->r_permission;
     return View('role.edit', compact('role', 'permissions', 'permission_role'));
 }
Beispiel #10
0
 public static function permission($permission, $encontristaId)
 {
     if (!self::guest($permission)) {
         return is_null(Permission::all()->where('encontrista_id', '=', $encontristaId)->where('permission', '=', $permission)->first());
     }
     return true;
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $user;
     switch (strtolower($this->option('permission'))) {
         case 'admin':
             $user = new User();
             $user->username = '******';
             $user->password = Hash::make('admin');
             $user->email = '*****@*****.**';
             $user->firstname = 'Joshua';
             $user->middlename = 'Agagdan';
             $user->lastname = 'Tundag';
             Permission::first()->users()->save($user);
             $user->save();
             break;
         case 'user':
             $user = new User();
             $user->username = '******';
             $user->password = Hash::make('gwapodz');
             $user->email = '*****@*****.**';
             $user->firstname = 'Ododz';
             $user->middlename = 'G';
             $user->lastname = 'Gwapodz';
             Permission::all()->get(1)->users()->save($user);
             $user->save();
             break;
     }
     return $user;
 }
 public function patchIndex(Role $role)
 {
     if (!$this->user->canAdminRoles() || !$this->user->canAdminPermissions()) {
         return abort(403);
     }
     $input = Input::all();
     $permissions = Permission::all();
     $rolePermissions = [];
     $nullPermissions = [];
     foreach ($permissions as $permission) {
         if ($this->user->can($permission->permission_id)) {
             $nullPermissions[] = $permission->permission_id;
             foreach ($input as $permission_id => $permission_value) {
                 $permission_id = str_replace("_", ".", $permission_id);
                 if ($permission->permission_id == $permission_id) {
                     switch ($permission_value) {
                         case "allow":
                         case "deny":
                             $rolePermissions[] = ['role_id' => $role->role_id, 'permission_id' => $permission_id, 'value' => $permission_value == "allow"];
                             break;
                     }
                     break;
                 }
             }
         }
     }
     RolePermission::where(['role_id' => $role->role_id])->whereIn('permission_id', $nullPermissions)->delete();
     RolePermission::insert($rolePermissions);
     return $this->view(static::VIEW_PERMISSIONS, ['role' => $role, 'permissions' => Permission::all()]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $permissions = Permission::all();
     if ($permissions) {
         return $this->respondWithCollection($permissions, new PermissionTransformer());
     }
     return $this->errorNotFound('No permissions found');
 }
 public function create()
 {
     try {
         return view('Admin.roles.create', ['roles' => Rolle::all(), 'permissions' => Permission::all()]);
     } catch (Exception $e) {
         return redirect()->route('admin::roles::list')->withErrors($e->getMessage());
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $role = Role::create(['name' => 'Admin']);
     foreach (Permission::all() as $permission) {
         $role->permissions()->save($permission);
     }
     Role::create(['name' => 'User']);
 }
Beispiel #16
0
 public function index()
 {
     // get all Roles
     $roles = App\Role::all();
     $allRole = "";
     foreach ($roles as $role) {
         $allRole .= "<th>" . $role->role_name . "</th>";
     }
     // get all Routes
     if (Route::getRoutes() == null) {
         return;
     } else {
         $routes = Route::getRoutes();
     }
     $allRoutes = array();
     foreach ($routes as $value) {
         $allRoutes[] = $value->getPath();
     }
     $routes = array_unique($allRoutes);
     // get all permission
     $permission = App\Permission::all()->toArray();
     $allRoutesInPermission = array();
     if (empty($permission)) {
         $allRoutesInPermission = null;
     } else {
         foreach ($permission as $value) {
             $allRoutesInPermission[] = $value['route'];
         }
     }
     $tableRoute = '';
     foreach ($routes as $route) {
         $tableRoute .= "<tr>";
         $tableRoute .= "<td>" . $route . "</td>";
         foreach ($roles as $role) {
             $input = $role->id . "|" . $route;
             if ($allRoutesInPermission == null) {
                 $tableRoute .= '<td><input type="checkbox" name="data[]" class="group-checkable" value="' . $input . '"></td>';
             } else {
                 if ($role->role_name == 'Admin') {
                     $tableRoute .= '<td ><input type = "checkbox" name="data[]" class="group-checkable" checked="checked" onclick="this.checked=!this.checked;" value="' . $input . '"></td >';
                 } else {
                     if (in_array($input, $allRoutesInPermission)) {
                         $tableRoute .= '<td ><input type = "checkbox" name="data[]" class="group-checkable" checked="checked" value="' . $input . '"></td >';
                     } else {
                         $tableRoute .= '<td ><input type = "checkbox" name="data[]" class="group-checkable" value="' . $input . '"></td >';
                     }
                 }
             }
         }
         $tableRoute .= "<tr>";
     }
     // display result in a view
     return view('admin.permission.list')->with(['allRoles' => $allRole, 'tableRoute' => $tableRoute]);
 }
 /**
  * Passes the required variables to the sidebar
  */
 public function ComposeWebPanelSidebar()
 {
     view()->composer('templates.' . \Config::get('webpanel.template') . 'webpanel.includes.sidebar', function ($view) {
         $view->with('storeItemCount', StoreItem::all()->count());
         $view->with('storeCategoryCount', StoreCategory::all()->count());
         $view->with('storeUserCount', StoreUser::all()->count());
         $view->with('storeServerCount', StoreServer::all()->count());
         $view->with('panelUserCount', User::all()->count());
         $view->with('panelRoleCount', Role::all()->count());
         $view->with('panelPermissionCount', Permission::all()->count());
     });
 }
Beispiel #18
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $role = new Role();
     $builder = $role->newQuery()->with('perms');
     $pagesize = $request->input('pagesize') ?: config('site.pagesize.admin.' . $role->getTable(), $this->site['pagesize']['common']);
     //view's variant
     $this->_pagesize = $pagesize;
     $this->_filters = $this->_getFilters($request, $builder);
     $this->_table_data = $this->_getPaginate($request, $builder, ['*']);
     $this->_perms_data = Permission::all();
     return $this->view('system::admin.role.list');
 }
 /**
  * Run the migrations.
  *
  * @return  void
  */
 public function up()
 {
     \App\Field::create(['name' => 'male', 'title' => '男', 'field_class' => 'gender'])->create(['name' => 'female', 'title' => '女', 'field_class' => 'gender'])->create(['name' => 'news', 'title' => '订阅号', 'field_class' => 'wechat_type'])->create(['name' => 'service', 'title' => '服务号', 'field_class' => 'wechat_type'])->create(['name' => 'enterprise', 'title' => '企业号', 'field_class' => 'wechat_type'])->create(['name' => 'depot', 'title' => '素材', 'field_class' => 'wechat_message_type'])->create(['name' => 'news', 'title' => '图文', 'field_class' => 'wechat_message_type'])->create(['name' => 'image', 'title' => '图片', 'field_class' => 'wechat_message_type'])->create(['name' => 'thumb', 'title' => '缩略图', 'field_class' => 'wechat_message_type'])->create(['name' => 'video', 'title' => '视频', 'field_class' => 'wechat_message_type'])->create(['name' => 'shortvideo', 'title' => '小视频', 'field_class' => 'wechat_message_type'])->create(['name' => 'voice', 'title' => '音频', 'field_class' => 'wechat_message_type'])->create(['name' => 'music', 'title' => '音乐', 'field_class' => 'wechat_message_type'])->create(['name' => 'text', 'title' => '文字', 'field_class' => 'wechat_message_type'])->create(['name' => 'link', 'title' => '连接', 'field_class' => 'wechat_message_type'])->create(['name' => 'location', 'title' => '地址', 'field_class' => 'wechat_message_type'])->create(['name' => 'callback', 'title' => '回调', 'field_class' => 'wechat_message_type'])->create(['name' => 'event', 'title' => '事件', 'field_class' => 'wechat_message_type'])->create(['name' => 'subscribe', 'title' => '关注', 'field_class' => 'wechat_event_type'])->create(['name' => 'unsubscribe', 'title' => '取消关注', 'field_class' => 'wechat_event_type'])->create(['name' => 'SCAN', 'title' => '扫描二维码', 'field_class' => 'wechat_event_type'])->create(['name' => 'LOCATION', 'title' => '地址', 'field_class' => 'wechat_event_type'])->create(['name' => 'CLICK', 'title' => '点击', 'field_class' => 'wechat_event_type'])->create(['name' => 'VIEW', 'title' => '视图', 'field_class' => 'wechat_event_type'])->create(['name' => 'scancode_push', 'title' => '扫描事件', 'field_class' => 'wechat_event_type'])->create(['name' => 'scancode_waitmsg', 'title' => '扫描事件「非跳转」', 'field_class' => 'wechat_event_type'])->create(['name' => 'pic_sysphoto', 'title' => '系统拍照发图', 'field_class' => 'wechat_event_type'])->create(['name' => 'pic_photo_or_album', 'title' => '拍照或者相册发图', 'field_class' => 'wechat_event_type'])->create(['name' => 'pic_weixin', 'title' => '相册发图', 'field_class' => 'wechat_event_type'])->create(['name' => 'location_select', 'title' => '地址选择', 'field_class' => 'wechat_event_type'])->create(['name' => 'XXS', 'title' => '特小号', 'field_class' => 'clothes_size_type'])->create(['name' => 'XS', 'title' => '加小号', 'field_class' => 'clothes_size_type'])->create(['name' => 'S', 'title' => '小号', 'field_class' => 'clothes_size_type'])->create(['name' => 'M', 'title' => '中号', 'field_class' => 'clothes_size_type'])->create(['name' => 'L', 'title' => '大号', 'field_class' => 'clothes_size_type'])->create(['name' => 'XL', 'title' => '加大号', 'field_class' => 'clothes_size_type'])->create(['name' => 'XXL', 'title' => '特大号', 'field_class' => 'clothes_size_type'])->create(['name' => 'XXXL', 'title' => '特特大号', 'field_class' => 'clothes_size_type'])->create(['name' => '27', 'title' => '腰围27', 'field_class' => 'clothes_size_type'])->create(['name' => '28', 'title' => '腰围28', 'field_class' => 'clothes_size_type'])->create(['name' => '29', 'title' => '腰围29', 'field_class' => 'clothes_size_type'])->create(['name' => '30', 'title' => '腰围30', 'field_class' => 'clothes_size_type'])->create(['name' => '31', 'title' => '腰围31', 'field_class' => 'clothes_size_type'])->create(['name' => '32', 'title' => '腰围32', 'field_class' => 'clothes_size_type'])->create(['name' => '33', 'title' => '腰围33', 'field_class' => 'clothes_size_type'])->create(['name' => '34', 'title' => '腰围34', 'field_class' => 'clothes_size_type'])->create(['name' => 'store', 'title' => '自提', 'field_class' => 'express_type'])->create(['name' => 'express', 'title' => '快递', 'field_class' => 'express_type'])->create(['name' => 'sf-express', 'title' => '顺丰快递', 'field_class' => 'express_name'])->create(['name' => 'sto-express', 'title' => '申通快递', 'field_class' => 'express_name'])->create(['name' => 'yto-express', 'title' => '圆通快递', 'field_class' => 'express_name'])->create(['name' => 'zto-express', 'title' => '中通快递', 'field_class' => 'express_name'])->create(['name' => 'ems', 'title' => 'EMS', 'field_class' => 'express_name'])->create(['name' => 'deppon', 'title' => '德邦物流', 'field_class' => 'express_name'])->create(['name' => 'china_bank', 'title' => '中国银行', 'field_class' => 'bank_name'])->create(['name' => 'construction_bank', 'title' => '中国建设银行', 'field_class' => 'bank_name'])->create(['name' => 'ICBC', 'title' => '中国工商银行', 'field_class' => 'bank_name'])->create(['name' => 'BOCOM', 'title' => '交通银行', 'field_class' => 'bank_name'])->create(['name' => 'agricultural_bank', 'title' => '中国农业银行', 'field_class' => 'bank_name'])->create(['name' => 'merchants_bank', 'title' => '招商银行', 'field_class' => 'bank_name'])->create(['name' => 'post_savings_bank', 'title' => '中国邮政储蓄银行', 'field_class' => 'bank_name'])->create(['name' => 'everbright_bank', 'title' => '中国光大银行', 'field_class' => 'bank_name'])->create(['name' => 'minsheng_bank', 'title' => '中国民生银行', 'field_class' => 'bank_name'])->create(['name' => 'pingan_bank', 'title' => '中国平安银行', 'field_class' => 'bank_name'])->create(['name' => 'SPD', 'title' => '浦发银行', 'field_class' => 'bank_name'])->create(['name' => 'CITIC', 'title' => '中信银行', 'field_class' => 'bank_name'])->create(['name' => 'industrial_bank', 'title' => '兴业银行', 'field_class' => 'bank_name'])->create(['name' => 'huaxia_bank', 'title' => '华夏银行', 'field_class' => 'bank_name'])->create(['name' => 'communications_bank', 'title' => '广发银行', 'field_class' => 'bank_name'])->create(['name' => '', 'title' => '无'])->update(['id' => 0]);
     \App\Role::create(['id' => 99, 'name' => 'admin', 'display_name' => '超级管理员', 'url' => 'admin'])->create(['id' => 98, 'name' => 'manager', 'display_name' => '项目总监', 'url' => 'admin'])->create(['id' => 97, 'name' => 'owner', 'display_name' => '经理', 'url' => 'admin'])->create(['id' => 96, 'name' => 'leader', 'display_name' => '负责人', 'url' => 'admin'])->create(['id' => 1, 'name' => 'viewer', 'display_name' => '普通用户', 'url' => ''])->create(['id' => 2, 'name' => 'wechater', 'display_name' => '微信用户', 'url' => ''])->create(['id' => 3, 'name' => 'factory', 'display_name' => '厂商'])->create(['id' => 4, 'name' => 'agent', 'display_name' => '代理商'])->create(['id' => 5, 'name' => 'store', 'display_name' => '门店'])->create(['id' => 0, 'name' => 'guest', 'display_name' => '访客', 'url' => ''])->update(['id' => 0]);
     foreach (['role' => '用户组、权限', 'attachment' => '附件', 'member' => '用户', 'factory' => '厂商', 'agent' => '代理商', 'store' => '门店', 'product' => '产品', 'wechat-account' => '微信公众号', 'wechat-depot' => '微信素材', 'wechat-menu' => '微信菜单', 'wechat-message' => '微信消息', 'wechat-reply' => '微信自定义回复', 'wechat-user' => '微信用户'] as $k => $v) {
         foreach (['view' => '查看', 'create' => '新建', 'edit' => '编辑', 'destroy' => '删除', 'export' => '导出'] as $k1 => $v1) {
             \App\Permission::create(['name' => $k . '.' . $k1, 'display_name' => '允许' . $v1 . $v]);
         }
     }
     \App\Role::find(99)->perms()->sync(\App\Permission::all());
     (new \App\User())->add(['username' => 'admin', 'password' => '123456', 'nickname' => '超级管理员'], \App\Role::ADMIN);
 }
 /**
  * Register any application authentication / authorization services.
  *
  * @param  \Illuminate\Contracts\Auth\Access\Gate  $gate
  * @return void
  */
 public function boot(GateContract $gate)
 {
     $this->registerPolicies($gate);
     $permissions = \App\Permission::all();
     foreach ($permissions as $permission) {
         $gate->define($permission->name, function ($user) use($permission) {
             foreach ($permission->roles as $role) {
                 if ($user->hasRole($role->name)) {
                     return true;
                 }
             }
             return false;
         });
     }
 }
Beispiel #21
0
 public function rolePermissionIndex()
 {
     $title = 'Role-Permission';
     $roles = array();
     $role = Role::all();
     foreach ($role as $r) {
         $roles[$r->id] = $r->display_name;
     }
     // $permissions = array();
     $permissions = Permission::all();
     /* foreach ($permission as $p) {
            $permissions[$p->id] = $p->name;
        }*/
     return view('Users.role_permission', ['title' => $title, 'roles' => $roles, 'permissions' => $permissions]);
 }
Beispiel #22
0
 private function _get_permissions()
 {
     // order the permission for page show, this is not necessary
     $all = Permission::all();
     $all_permissions = array();
     foreach ($all as $key => $one) {
         if (strpos($one->permission, '/') === false) {
             $all_permissions[$one->permission][] = $one;
             continue;
         }
         $temp = explode('/', $one->permission);
         $all_permissions[$temp[1]][] = $one;
     }
     return $all_permissions;
 }
Beispiel #23
0
 public function show($id)
 {
     $permissions = Permission::all()->toArray();
     $role = Role::find($id);
     $rolePermissions = $role->perms()->select('id')->get()->toArray();
     $roleIds = [];
     foreach ($rolePermissions as $rolePermission) {
         $roleIds[] = $rolePermission['id'];
     }
     $permissions = array_map(function ($permission) use($roleIds) {
         if (in_array($permission['id'], $roleIds)) {
             $permission['selected'] = true;
         }
         return $permission;
     }, $permissions);
     return view('permission.show', ['id' => $id, 'permissions' => $permissions]);
 }
Beispiel #24
0
 public function can($id)
 {
     $role = Role::find($id);
     //所有权限
     $all_permissions = Permission::all();
     //管理员所拥有的权限
     $permissions = $role->permissions()->get();
     foreach ($all_permissions as $k => $p) {
         foreach ($permissions as $per) {
             if ($p->id === $per->id) {
                 $all_permissions[$k]['can'] = 1;
             }
         }
     }
     //dd($permissions);
     return view('admin.role.can', compact('role', 'all_permissions'));
 }
 public function run()
 {
     try {
         $query = Permission::all(array("name"));
         $godModePermissions = [];
         foreach ($query as $q) {
             $godModePermissions[$q->name] = 1;
         }
         $name = "God Mode";
         //ana kayıt
         $createGroupQuery = new Group();
         $createGroupQuery->name = $name;
         $createGroupQuery->slug = str_slug($name);
         $createGroupQuery->permissions = $godModePermissions;
         $createGroupQuery->save();
     } catch (Cartalyst\Sentry\Groups\NameRequiredException $e) {
         echo 'Name field is required';
     } catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
         echo 'Group already exists';
     }
 }
Beispiel #26
0
 /**
  *  Display the user dashboard
  *
  */
 public function dashboard()
 {
     // Get user data to display
     $user = Auth::user();
     $job_list = array('paladin' => 'Paladin', 'monk' => 'Monk', 'warrior' => 'Warrior', 'dragoon' => 'Dragoon', 'bard' => 'Bard', 'ninja' => 'Ninja', 'white-mage' => 'White Mage', 'black-mage' => 'Black Mage', 'scholar' => 'Scholar', 'summoner' => 'Summoner', 'dark-knight' => 'Dark Knight', 'machinist' => 'Machinist', 'astrologian' => 'Astrologian');
     // Have a look for any posts that mention the user
     $mention_posts = collect();
     if ($user->character_name) {
         $character_name = explode(' ', $user->character_name);
         $mention_posts = Post::with('thread')->with('user')->where('content', 'like', '%@' . $character_name[0] . '%')->orWhere('content', 'like', '%@' . $character_name[0] . $character_name[1] . '%')->orderBy('created_at', 'DESC')->limit(5)->get();
     }
     // Get the latest topics
     // Get the users permissions
     $accessCollection = $user->forumAccess;
     $latest_posts = Post::with('thread')->with('user')->whereIn('forum_id', $accessCollection)->orderBy('created_at', 'DESC')->limit(7)->get();
     if ($user->hasRole('administrators')) {
         $group_list = Role::all();
         $group_array = array();
         foreach ($group_list as $group) {
             $group_array[$group->id] = $group->display_name;
         }
         $permission_list = Permission::all();
         $permission_array = array();
         foreach ($permission_list as $permission) {
             $permission_array[$permission->id] = $permission->display_name;
         }
         $users_list = User::all();
         $users_array = array();
         foreach ($users_list as $users) {
             $users_array[$users->id] = $users->character_name ? $users->character_name : $users->name;
         }
         $forums_list = Forum::orderBy('display_order', 'asc')->get();
         return view('user.dashboard')->withUser($user)->withMentionPosts($mention_posts)->withLatestPosts($latest_posts)->withJobList($job_list)->withGroupList($group_list)->withGroupArray($group_array)->withPermissionArray($permission_array)->withUsersArray($users_array)->withForumList($forums_list);
     } else {
         return view('user.dashboard')->withUser($user)->withJobList($job_list)->withMentionPosts($mention_posts)->withLatestPosts($latest_posts);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $permissions = Permission::all();
     return View('permissions.index', compact('permissions'));
 }
Beispiel #28
0
 private function getPermissions()
 {
     return Permission::all();
 }
 /**
  * This class is the repository for all permission queries
  */
 public static function getAllPermissions()
 {
     return Permission::all();
 }
 public function getAll()
 {
     return Permission::all();
 }