am-impact / amnav

Navigation plugin for Craft
168 stars 19 forks source link

Editing locales the user has no permission for #94

Open janhenckens opened 7 years ago

janhenckens commented 7 years ago

When editing the navigation as a user who only has permissions to edit a locale that is not the default site locale, the user would initially see the default locale in the edit screen.

This change checks the locales for which the current user has permissions and show the first one (same behaviour as the dropdown does in the top right).

The fall back to the default site locale is still there, for users who don't have permissions for any locales. That now returns the navigation in the default locale, which is also quite bad as the user doesn't have permission for that, but I'm not sure how to proceed in that case.

Feel free to comment, happy to help out with fixing that last issue.