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