A role check in a view can hide a menu item the user cannot use. Protect the controller action independently with server-side authorization.
Test both a permitted user and a user who types the protected URL directly. Keep the policy definition in a place shared by the endpoint and other authorization logic, so a display change does not accidentally become the only access check.
Leave a Reply