J0NNY ZER0
J0NNY ZER0

Reputation: 707

MVC3 - Placing Role Athorization on @Html.Actionlink()

What is the best and/or most efficient way to place Authorization on an @Html.Actionlink so so those not authrorized DO NOT SEE THE LINK.

Upvotes: 1

Views: 1315

Answers (2)

Adam Tuliper
Adam Tuliper

Reputation: 30152

Mystere Man was indeed first to the punch here and deserves credit, but to provide additional info this has been asked here in other similar scenarios:

User permissions on certain views based on roles

Upvotes: 0

Erik Funkenbusch
Erik Funkenbusch

Reputation: 93464

@if (User.IsInRole("Administrators")) { Html.ActionLink(...) }

Upvotes: 2

Related Questions