本文整理汇总了PHP中Sentry::findAllUsersWithAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentry::findAllUsersWithAccess方法的具体用法?PHP Sentry::findAllUsersWithAccess怎么用?PHP Sentry::findAllUsersWithAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentry
的用法示例。
在下文中一共展示了Sentry::findAllUsersWithAccess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getManageUser
public function getManageUser()
{
$operator = Sentry::findAllUsersWithAccess('operator');
$operatorCollection = new Illuminate\Database\Eloquent\Collection($operator);
$data = Datatable::collection($operatorCollection)->addColumn('full_name', function ($model) {
return $model->first_name . ' ' . $model->last_name;
})->showColumns('id', 'email', 'last_login')->searchColumns('full_name', 'email', 'last_login')->orderColumns('full_name', 'email', 'last_login')->make();
$group = Group::all();
return View::make('dashboard.admin.manageuser')->with('group', $group);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
if (Datatable::shouldHandle()) {
$operator = Sentry::findAllUsersWithAccess('operator');
$operatorCollection = new Illuminate\Database\Eloquent\Collection($operator);
return Datatable::collection($operatorCollection)->addColumn('full_name', function ($model) {
return $model->first_name . ' ' . $model->last_name;
})->showColumns('id', 'email', 'last_login')->searchColumns('full_name', 'email', 'last_login')->orderColumns('full_name', 'email', 'last_login')->make();
}
return View::make('dashboard.admin.manageuser');
}
示例3: compact
break;
case 'never':
break;
}
$template = $fax['sent'] ? 'emails.fax.sent.success' : 'emails.fax.sent.failed';
if ($send) {
Mail::send($template, compact('fax'), function ($message) use($fax) {
$status = $fax['sent'] ? 'successfully sent' : 'sending failed';
$message->to($fax['user']['email'])->subject('Fax ' . $status);
});
}
}
if ($fax['direction'] == 'received') {
$phoneViewer = Permission::name('Faxbox\\Repositories\\Phone\\PhoneInterface', 'view', $fax['phone']['id']);
$phoneAdmin = Permission::name('Faxbox\\Repositories\\Phone\\PhoneInterface', 'admin', $fax['phone']['id']);
$users = Sentry::findAllUsersWithAccess([$phoneViewer, $phoneAdmin]);
foreach ($users as $user) {
$send = false;
switch ($user->received_notification) {
case 'always':
$send = true;
break;
case 'mine':
$send = $user->hasAccess($phoneAdmin);
break;
case 'groups':
// todo check groups
break;
case 'never':
break;
}