本文整理汇总了PHP中Sentry::hasAnyAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentry::hasAnyAccess方法的具体用法?PHP Sentry::hasAnyAccess怎么用?PHP Sentry::hasAnyAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentry
的用法示例。
在下文中一共展示了Sentry::hasAnyAccess方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: putAdminUpdate
/**
* admin.notaries.update
*
*/
public function putAdminUpdate($id)
{
if (Sentry::hasAnyAccess(['notaries_update'])) {
$answer = $this->notary->updateNotary(Input::all(), $id);
if ($answer['error'] == true) {
return Redirect::route('admin.notaries.edit', $id)->withErrors($answer['message'])->withInput();
} else {
return Redirect::route('admin.notaries.edit', $id)->with(['message' => $answer['message'], 'class' => 'success']);
}
} else {
return Redirect::route('pages.error');
}
}
示例2: putUserUpdate
/**
* users.profiles.update
*
*/
public function putUserUpdate($id)
{
if (Sentry::hasAnyAccess(['profiles_update'])) {
$answer = $this->profile->updateProfile(Input::all(), $id);
if ($answer['error'] == true) {
return Redirect::route('users.profiles.edit', $id)->withErrors($answer['message'])->withInput;
} else {
return Redirect::route('users.profiles.edit', $id)->with(['message' => $answer['message'], 'class' => 'success']);
}
} else {
return Redirect::route('pages.error');
}
}
示例3: putAdminUpdate
/**
* admin.groups.update
*
*/
public function putAdminUpdate($id)
{
if (Sentry::hasAnyAccess(['groups_update'])) {
try {
$group = Sentry::findGroupById($id);
$group->name = Input::get('name');
$group->permissions = ['admin' => Input::get('admin'), 'deeds_index' => Input::get('deeds_index'), 'deeds_create' => Input::get('deeds_create'), 'deeds_update' => Input::get('deeds_update'), 'deeds_delete' => Input::get('deeds_delete'), 'agrarians_index' => Input::get('agrarians_index'), 'agrarians_create' => Input::get('agrarians_create'), 'agrarians_update' => Input::get('agrarians_update'), 'agrarians_delete' => Input::get('agrarians_delete'), 'civils_index' => Input::get('civils_index'), 'civils_create' => Input::get('civils_create'), 'civils_update' => Input::get('civils_update'), 'civils_delete' => Input::get('civils_delete'), 'penals_index' => Input::get('penals_index'), 'penals_create' => Input::get('penals_create'), 'penals_update' => Input::get('penals_update'), 'penals_delete' => Input::get('penals_delete'), 'records_index' => Input::get('records_index'), 'records_create' => Input::get('records_create'), 'records_update' => Input::get('records_update'), 'records_delete' => Input::get('records_delete'), 'notaries_index' => Input::get('notaries_index'), 'notaries_create' => Input::get('notaries_create'), 'notaries_update' => Input::get('notaries_update'), 'notaries_delete' => Input::get('notaries_delete'), 'municipalities_index' => Input::get('municipalities_index'), 'municipalities_create' => Input::get('municipalities_create'), 'municipalities_update' => Input::get('municipalities_update'), 'municipalities_delete' => Input::get('municipalities_delete'), 'users_index' => Input::get('users_index'), 'users_create' => Input::get('users_create'), 'users_update' => Input::get('users_update'), 'users_delete' => Input::get('users_delete'), 'groups_index' => Input::get('groups_index'), 'groups_create' => Input::get('groups_create'), 'groups_update' => Input::get('groups_update'), 'groups_delete' => Input::get('groups_delete')];
$group->save();
return Redirect::route('admin.groups.edit', $id)->with(['message' => 'El grupo fue actualizado con exito!', 'class' => 'success']);
} catch (Cartalyst\Sentry\Groups\NameRequiredException $e) {
return Redirect::route('admin.groups.edit', $id)->with(['message' => 'El nombre es requerido', 'class' => 'warning']);
} catch (Cartalyst\Sentry\Groups\GroupExistsException $e) {
return Redirect::route('admin.groups.edit', $id)->with(['message' => 'El grupo ya existe', 'class' => 'warning']);
} catch (Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
return Redirect::route('admin.groups.edit', $id)->with(['message' => 'El grupo no fue encontrado.', 'class' => 'danger']);
}
} else {
return Redirect::route('pages.error');
}
}
示例4: getUserIndex
/**
* users.agrarians.indez
*
*/
public function getUserIndex()
{
if (Sentry::hasAnyAccess(['users'])) {
if (Request::ajax()) {
$result = DB::table('agrarians')->select(array('agrarians.id', 'agrarians.number_agrarian as number', 'agrarians.date as date', 'agrarians.demandant as demandant', 'agrarians.defendant as defendant', 'agrarians.secretary as secretary', 'agrarians.matery as matery', 'agrarians.created_at as created'))->where('agrarians.status', '=', 1);
return Datatable::query($result)->searchColumns('number_agrarian', 'date', 'demandant', 'defendant', 'secretary', 'matery')->orderColumns('created', 'id', 'number_agrarian')->showColumns('id', 'number', 'date', 'demandant', 'defendant', 'secretary', 'matery')->make();
} else {
return View::make('agrarians.user.index');
}
} else {
return Redirect::route('pages.error');
}
}
示例5: postAdminRole
/**
* admin.users.role.post
*
*/
public function postAdminRole($id)
{
if (Sentry::hasAnyAccess(['users_update'])) {
$sentry = Sentry::findUserById($id);
$groups_1 = Sentry::findAllGroups();
$groups = Input::get('groups');
foreach ($groups_1 as $group_1) {
$sentry->groups()->detach($group_1);
}
if (isset($groups)) {
foreach ($groups as $group) {
$sentry->groups()->attach($group);
}
}
return Redirect::route('admin.users.role', $id)->with(['message' => 'Fue un exito la operación!', 'class' => 'success']);
} else {
return Redirect::route('pages.error');
}
}
示例6: getUserIndex
/**
* users.penals.index
*
*/
public function getUserIndex()
{
if (Sentry::hasAnyAccess(['users'])) {
if (Request::ajax()) {
$result = DB::table('penals')->select(array('penals.id', 'penals.number_penal as number', 'penals.start_date as date', 'penals.acussed as acussed', 'penals.aggrieved as aggrieved', 'penals.judge as judge', 'penals.scribe as scribe', 'penals.created_at as created'))->where('penals.status', '=', 1);
return Datatable::query($result)->searchColumns('number_penal', 'date', 'acussed', 'aggrieved', 'judge', 'scribe')->orderColumns('created', 'id', 'number_penal')->showColumns('id', 'number', 'date', 'acussed', 'aggrieved', 'judge', 'scribe')->make();
} else {
return View::make('penals.user.index');
}
} else {
return Redirect::route('pages.error');
}
}
示例7: getUserIndex
/**
* users.deeds.index
*
*/
public function getUserIndex()
{
if (Sentry::hasAnyAccess(['users'])) {
if (Request::ajax()) {
$result = DB::table('deeds')->select(array('deeds.id', 'notaries.name as name', 'deeds.number_deeds as number', 'deeds.protocol as protocol', 'deeds.folio as folio', 'deeds.given_by as given', 'deeds.pro as pro', 'deeds.created_at as created'))->join('notaries', 'deeds.notary_id', '=', 'notaries.id')->where('deeds.status', '=', 1);
return Datatable::query($result)->searchColumns('name', 'number_deeds', 'protocol', 'given_by', 'pro')->orderColumns('created', 'id', 'number_deeds')->showColumns('id', 'name', 'number', 'protocol', 'folio', 'given', 'pro')->make();
} else {
return View::make('deeds.user.index');
}
} else {
return Redirect::route('pages.error');
}
}