We are using Umbraco Forms 7.4.1. I was wondering, if there is a way to use Umbraco Forms with more than one security role? At the moment this seems to be not possible.
For example, if some user is logged in and part of the group "Accredited" (because he/she has an accreditation) and "Nominee" (in one of our competitions), he/she can't use Umbraco Forms and only gets the message:
Thank you for your reply!
Yes, please find it below:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@if (Model.MacroParameters["FormGuid"] != null)
{
var s = Model.MacroParameters["FormGuid"].ToString();
var theme = "";
var includeScripts = true;
@*
If a theme is provided as a macro parameter, forms will attempt to use custom theme files
ex: given the value "test", forms will look up views for the form and fields in a custom directory:
Form will be rendered with
/Views/Partials/Forms/Themes/test/form.cshml
Fields will be rendered with
/Views/Partials/Forms/Themes/test/FieldType/[fieldtypename].cshtml
If a file is not available in the custom directory, forms will fallback to the default files in
/Views/Partials/Forms/Themes/default/
*@
if(Model.MacroParameters.ContainsKey("FormTheme"))
{
theme = Model.MacroParameters["FormTheme"].ToString();
}
if (Model.MacroParameters.ContainsKey("ExcludeScripts"))
{
@*
Inverse the boolean - RenderAction Parameter expects it to be false for exclusion
But with default value for Macro Paramater boolean/checkbox being false
We want to ensure by default we include the scripts next to the form
*@
includeScripts = Model.MacroParameters["ExcludeScripts"].ToString() == "0";
}
var form = new Guid(s);
var recordGuid = Guid.Empty;
if (string.IsNullOrEmpty(Request.QueryString["recordId"]) == false)
{
Guid.TryParse(Request.QueryString["recordId"], out recordGuid);
}
Html.RenderAction("RenderForm", "UmbracoForms", new {formId = form, recordId = recordGuid, theme = theme, includeScripts = includeScripts });
}
Umbraco Forms: SecurityRoles?
Hi everyone,
We are using Umbraco Forms 7.4.1. I was wondering, if there is a way to use Umbraco Forms with more than one security role? At the moment this seems to be not possible.
For example, if some user is logged in and part of the group "Accredited" (because he/she has an accreditation) and "Nominee" (in one of our competitions), he/she can't use Umbraco Forms and only gets the message:
When I remove one of the security roles or the user is not logged in, he/she can access the form without problems.
Is there a way to get it working?
Best, Simeon
Hi everyone,
I would be happy to get a reply on this...
Thanks a lot!
Best, Simeon
could you post the content of InsertUmbracoFormWithTheme.cshtml
Hi Huw,
Thank you for your reply! Yes, please find it below:
Best, Simeon
Nothing in there that relates to security roles, are there any errors in the umbraco log that may give more detail on what is happening?
Hi Huw,
Thanks for your reply. Indeed there are error messages in the log:
Best, Simeon
looks like a problem with your username, what is the username you are logging in with?
From what I can say, only my last name. I will ask our IT support, if there is more than just the last name.
Thanks for the moment!
most likely it has a character in it that it doesn't appear to like
Hi Huw,
Our IT specialist told me, that he debugged Umbraco Forms and found the issue. It was something about the function, how the user name was taken.
Thanks for the hint to the right way :)
Best, Simeon
no problem, glad it helped.
is working on a reply...