@permission 修改用户页面

@param Administrator $user
@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
175693
public function edit(Administrator $user)
    {
        $this->authorizeForUser($this->user(), 'update', $user);

        $roles = Role::all();
        $header = '用户管理';
        $description = '修改';
        return view('admin::system.user-edit', compact('roles', 'header', 'description', 'user'));
    }
197266
public function edit(User $user)
    {
        return $this->makeResponse('edit', [
            'user' => $user,
            'roles' => $this->roles,
            'x_fields' => $this->x_fields,
        ]);
    }
534340
private function listUserAuthorizedCollections(User $user)
    {
        $acl = $this->getAclForUser($user);
        $rights = $acl->get_bas_rights();
        $bases = $acl->get_granted_base();

        $grants = [];

        $statusMapper = new RestrictedStatusExtractor($acl, $this->getApplicationBox());

        foreach ($bases as $base) {
            $baseGrants = [];

            foreach ($rights as $right) {
                if (!$acl->has_right_on_base($base->get_base_id(), $right)) {
                    continue;
                }

                $baseGrants[] = $right;
            }

            $grants[] = [
                'databox_id'    => $base->get_sbas_id(),
                'base_id'       => $base->get_base_id(),
                'collection_id' => $base->get_coll_id(),
                'name'          => $base->get_name(),
                'logo'          => $base->get_binary_minilogos() ? base64_encode($base->get_binary_minilogos()) : '',
                'labels'        => [
                    'fr' => $base->get_label('fr'),
                    'en' => $base->get_label('en'),
                    'de' => $base->get_label('de'),
                    'nl' => $base->get_label('nl'),
                ],
                'rights'        => $baseGrants,
                'statuses'      => $statusMapper->getRestrictedStatuses($base->get_base_id())
            ];
        }

        return $grants;
    }
1221239
protected function gatherPermissions(UserInterface $user = null)
    {
        $user = $user ?: $this->currentUser();
        $roles = $user->getRoles();
        $permissions = $user->getPermissions();

        foreach ($roles as $role) {
            if (isset($this->roleDictionary[$role])) {
                $permissions = array_merge($permissions, $this->roleDictionary[$role]);
            }
        }

        return $permissions;
    }
1236807
protected function checkPermission(User $user, $model, $action)
    {
        $dataType = Admin::model('DataType');
        $dataType = $dataType->where('model_name', get_class($model))->first();

        return $user->hasPermission($action.'_'.$dataType->slug);
    }
888946
public function edit(User $user)
    {
        $roles = Role::all();
        $permissions = Permission::all();
        return view('chuckcms::backend.users.edit', compact('user', 'roles', 'permissions'));
    }
518246
public function generateAvatar(User $user)
    {
        if ($user->getAvatar()) {
            return $this->uploadDir['web_path'].$user->getAvatar();
        } else {
            return $this->container->getParameter('symfonyid.admin.user.default_avatar');
        }
    }
183188
protected function getUserPermissions($user)
    {
        $permissions = $this->manager->getDriver()->getCallerPermissions($user);
        $collection = new Collection();
        foreach ($permissions as $permission) {
            if ($permission instanceof Restriction) {
                continue;
            }
            $collection->allow($permission->getAction(), $permission->getResourceType(), $permission->getResourceId());
        }
        return $collection;
    }
536353
public function grantAccessByPermissions($permissions, UserInterface $user = null)
    {
        $user = $user ? : $this->currentUser;
        return count(array_diff($permissions, $this->gatherPermissions($user))) === 0;
    }
1304217
public function edit(User $user)
    {
        $roles         = $this->getAllowedRoles();
        $selectedRoles = $user->roles()->pluck('roles.id');

        return view('administrator.users.edit', compact('user', 'roles', 'selectedRoles'));
    }
558229
public static function accessPossible(User $user, $controller, $action) {
        return self::getImplementation()->accessPossible($user, $controller, $action);
    }
283686
public function show(Request $request, $user)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin']);

        // Return view with user object
        $user = User::findOrFail($user);
        return view('user::show', ['user' => $user]);
    }
1156705
public function view($user, Ticket $ticket)
    {
        if ($ticket->admin_id == $user->id) {
            return true;
        }

        return User::findOrFail($user->id)->hasPermission('laralum::tickets.view');
    }
905009
private function hasPermission(AuthenticatedUserInterface $user, string $uri) {

        // Collect permissions
        $permissions = $this->getParameterByKey("permissions");

        // Iterate over permission
        foreach ($permissions as $permissionPath => $acceptableRoles) {
            if($permissionPath[0] !== "/") {
                $permissionPath = "/".$permissionPath;
            }
            if(substr($permissionPath,-1) !== "/") {
                $permissionPath = $permissionPath."/";
            }
            $match = preg_match($permissionPath,$uri);
            if ($match == 1) {
                if(in_array(Role::ANON_USER,$acceptableRoles)) return true;
                foreach ($acceptableRoles as $permissionRole) {
                    if(in_array($permissionRole,$user->getRoles())) return true;
                }
                return false;
            }
        }
        return false;
    }
11379
public function hasPermission($module, $action, User $user = null) {
		$module = $this->service->getModuleManager()->load($module);
		$action = $module->getActionModel($action);
		return $this->hasActionPermission($action, $user);
	}
700629
public function access($user)
    {
        $user = User::findOrFail($user->id);

        return $user->hasPermission('laralum::users.access') || $user->superAdmin();
    }
956210
private function doResetAdminRights(User $user)
    {
        $acl = $this->ACLProvider->get($user);
        $databoxes = $this->appbox->get_databoxes();

        $acl->give_access_to_sbas(array_map(function (\databox $databox) {
            return $databox->get_sbas_id();
        }, $databoxes));

        foreach ($databoxes as $databox) {
            $this->doResetAdminRightsOnDatabox($acl, $databox);
        }
    }