Пример #1
0
 public function update(Role $role)
 {
     $permissions = PermissionModel::all();
     $permissionsArray = unserialize($role->permissions);
     if (!is_array($permissionsArray)) {
         $permissionsArray = [];
     }
     return $this->theme->baseDashboard('UserManagement::role.create')->with('role', $role)->with('permissions', $permissions)->with('permissionsArray', $permissionsArray);
 }
Пример #2
0
 public function update(User $user)
 {
     if ($user->id != 1) {
         $roles = Role::all();
         $permissions = PermissionModel::all();
         $rolesArray = unserialize($user->roles);
         if (!is_array($rolesArray)) {
             $rolesArray = [];
         }
         $permissionsArray = unserialize($user->permissions);
         if (!is_array($permissionsArray)) {
             $permissionsArray = [];
         }
         return $this->theme->baseDashboard('UserManagement::user.create')->with("User", $user)->with('roles', $roles)->with('permissions', $permissions)->with("rolesArray", $rolesArray)->with("permissionsArray", $permissionsArray);
     }
 }
Пример #3
0
 public function index()
 {
     $permissions = PermissionModel::all();
     return $this->theme->baseDashboard("UserManagement::permission.index", ["permissions" => $permissions]);
 }