You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When browsing products in public store, show link 'Edit Product', when user is administrator (or have sufficient rights). Great time-saver for minor changes in products
Add public bool CurrentUserHasEditPermission { get; set; } to \Models\Catalog\ProductDetailsModel.cs
To ProductController, PrepareProductDetailsModel add
//does the current user have edit permission?
model.CurrentUserHasEditPermission = _permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel) &&
_permissionService.Authorize(StandardPermissionProvider.ManageProducts);
To \Views\Product\ProductTemplate.Simple.cshtml and \Views\Product\ProductTemplate.Griouped.cshtml add something like the code below
@if (Model.CurrentUserHasEditPermission)
{
<div class="edit-product">
<a href="@Url.Action("Edit", "Product", new {id = Model.Id, area = "Admin"})">@T("Common.Edit")</a>
</div>
}
AndreiMaz
changed the title
Public store. Display "Edit" link to appropriate admin pages if a user has an appropriate permissions (e.g. "Edit product")
Public store. Display "Edit" link on the product details page if a user has such permission
Mar 8, 2016
AndreiMaz
changed the title
Public store. Display "Edit" link on the product details page if a user has such permission
Display "Edit" link on the product details page (public store) if a user has such permission
Mar 8, 2016
When browsing products in public store, show link 'Edit Product', when user is administrator (or have sufficient rights). Great time-saver for minor changes in products
Add public bool CurrentUserHasEditPermission { get; set; } to \Models\Catalog\ProductDetailsModel.cs
To ProductController, PrepareProductDetailsModel add
//does the current user have edit permission?
model.CurrentUserHasEditPermission = _permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel) &&
_permissionService.Authorize(StandardPermissionProvider.ManageProducts);
To \Views\Product\ProductTemplate.Simple.cshtml and \Views\Product\ProductTemplate.Griouped.cshtml add something like the code below
We just need to create better UI. Good idea - http://codepen.io/MeredithU/pen/jcsvx (but should we attach "font-awesome" just for one icon?
Please see http://www.nopcommerce.com/boards/t/41611/feature-request-front-end-edit-option-for-admins.aspx (put it to the top -"Administration" link)
P.S. Right now ignore for vendors
The text was updated successfully, but these errors were encountered: