From 5d9a935621c3814b627c9279fa56b4666e780e8d Mon Sep 17 00:00:00 2001 From: Jordan Lane Date: Thu, 29 Oct 2015 16:50:00 +0000 Subject: [PATCH] Adds a check to include users in the send to translation list that have the translate permission for current page http://issues.umbraco.org/issue/U4-6094# --- .../umbraco/dialogs/sendToTranslation.aspx.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs index 588bbe5bfc..80118b4836 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs @@ -70,7 +70,7 @@ namespace umbraco.presentation.dialogs // Translators foreach (var u in BusinessLogic.User.getAll()) - if (u.UserType.Alias.ToLower() == "translator") + if (u.UserType.Alias.ToLower() == "translator" || UserHasTranslatePermission(u, _currentPage)) translator.Items.Add(new ListItem(u.Name, u.Id.ToString())); if (translator.Items.Count == 0) { @@ -84,6 +84,12 @@ namespace umbraco.presentation.dialogs } } + private bool UserHasTranslatePermission(BusinessLogic.User u, CMSNode node) + { + //the permissions column in umbracoUserType is legacy and needs to be rewritten but for now this is the only way to test + return u.GetPermissions(node.Path).Contains("4"); + } + protected void doTranslation_Click(object sender, EventArgs e) { // testing translate