本文整理汇总了PHP中app\Project::isUserAuthor方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::isUserAuthor方法的具体用法?PHP Project::isUserAuthor怎么用?PHP Project::isUserAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Project
的用法示例。
在下文中一共展示了Project::isUserAuthor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authToKick
/**
* Determine if the given user has appropriate privileges to kick a user from a project
* Checks if user is a admin for the project and the user to be kicked is not a admin or the project owner
*
* @param User $user
* @param Project $project
* @param ProjectMember $member
* @return bool
*/
public function authToKick(User $user, Project $project, ProjectMember $member)
{
return $project->isUserAuthor($user) || $project->isProjectAdmin($user->id) && !$project->isProjectAdmin($member->user->id) && !$project->isUserAuthor($member->user);
}
示例2: editBody
/**
* Updates the project body with what the user supplied
*
* @param ProjectBodyRequest $request
* @param Project $project
* @return view Previous view (project view)
*/
public function editBody(ProjectBodyRequest $request, Project $project)
{
if (!$project->isUserAuthor(Auth::user())) {
abort(403);
}
$project->body = $request->getBody();
$project->save();
return back();
}