本文整理匯總了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;
}