本文整理汇总了PHP中Permission::preparePermissionsForDisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP Permission::preparePermissionsForDisplay方法的具体用法?PHP Permission::preparePermissionsForDisplay怎么用?PHP Permission::preparePermissionsForDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permission
的用法示例。
在下文中一共展示了Permission::preparePermissionsForDisplay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEdit
/**
* Show the form for editing the specified resource.
*
* @param $map
* @return Response
*/
public function getEdit($map)
{
if (!empty($map)) {
$permissions = $this->permission->preparePermissionsForDisplay($map->perms()->get());
} else {
return Api::to(array('error', Lang::get('admin/maps/messages.does_not_exist'))) ?: Redirect::to('admin/maps')->with('error', Lang::get('admin/maps/messages.does_not_exist'));
}
$title = Lang::get('admin/maps/title.role_update');
return Theme::make('admin/maps/edit', compact('map', 'permissions', 'title'));
}
示例2: getEdit
/**
* Show the form for editing the specified resource.
*
* @param $role
* @return Response
*/
public function getEdit($role)
{
if (!empty($role)) {
$permissions = $this->permission->preparePermissionsForDisplay($role->perms()->get());
} else {
return Redirect::to('admin/roles')->with('error', Lang::get('admin/roles/messages.does_not_exist'));
}
$title = Lang::get('admin/roles/title.role_update');
return View::make('admin/roles/edit', compact('role', 'permissions', 'title'));
}
示例3: delete
/**
* Remove user page.
*
* @param $role
* @return Response
*/
public function delete($role)
{
// Title
$title = Lang::get('admin/role/title.role_delete');
if ($role->id) {
$permissions = $this->permission->preparePermissionsForDisplay($role->perms()->get());
} else {
// Redirect to the role management page
return Redirect::to('admin/roles')->with('error', Lang::get('admin/role/messages.does_not_exist'));
}
// Show the record
return View::make('admin/role/delete', compact('role', 'permissions', 'title'));
}
示例4: edit
/**
* Show the form for editing the specified resource.
*
* @param $role
* @return Response
*/
public function edit($id)
{
$role = Role::find($id);
if (!empty($role)) {
$permissions = $this->permission->preparePermissionsForDisplay($role->perms()->get());
} else {
// Redirect to the roles management page
return Redirect::to('admin.roles')->with('error', Lang::get('admin/roles/messages.does_not_exist'));
}
// Title
$title = Lang::get('admin/roles/title.role_update');
// Show the page
$this->render('admin/roles/edit', compact('role', 'permissions', 'title'));
}