本文整理汇总了PHP中app\User::isSuperAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP User::isSuperAdmin方法的具体用法?PHP User::isSuperAdmin怎么用?PHP User::isSuperAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\User
的用法示例。
在下文中一共展示了User::isSuperAdmin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete(User $user, Shout $shout)
{
if ($user->isSuperAdmin()) {
return true;
}
return $user->id === $shout->user_id;
}
示例2: edit
public function edit(User $user, CodeWarQuestion $question)
{
if ($user->isSuperAdmin()) {
return true;
}
if (!$user->isAdmin()) {
return false;
}
return $question->user_id == $user->id;
}
示例3: edit
public function edit(User $user, Quote $quote)
{
if ($user->isSuperAdmin()) {
return true;
}
if (!$user->isAdmin()) {
return false;
}
return $quote->user_id == $user->id;
}
示例4: edit
public function edit(User $user, CodeWarAnswer $answer)
{
if ($user->isSuperAdmin()) {
return true;
}
/**
* If War Closed
*/
if (!$answer->question->isOpen()) {
return false;
}
return $answer->user_id == $user->id;
}
示例5: canBeDeletedBy
public function canBeDeletedBy(User $user)
{
/**
* For Admin View
* It disable delete btn in admin view when viewed with trashed
*/
if (!is_null($this->deleted_at)) {
return false;
}
if ($user->isSuperAdmin()) {
return true;
}
return $user->id === $this->sender_id;
}
示例6: delete
public function delete(User $user, Message $message)
{
/**
* For Admin View
* It disable delete btn in admin view when viewed with trashed
*/
if (!is_null($message->deleted_at)) {
return false;
}
if ($user->isSuperAdmin()) {
return true;
}
return $user->id === $message->sender_id;
}
示例7: showedit
public function showedit(User $user)
{
return $user->isSuperAdmin();
}
示例8: isUserOrAdmin
/**
* Check if the logged in user is admin or user of any organization.
* @param User $user
* @return bool
*/
function isUserOrAdmin(User $user)
{
if (!$user->isSuperAdmin() && !$user->isGroupAdmin()) {
return true;
}
return false;
}