-
You should be able to leave out the DataProviderPlugin if you just store the FormDefinitionFile in ~/App_Data/Composite/DynamicTypeForms
-
In your form definition its more flexible to add the possible roles like this
<MultiKeySelector.Options>
<ff:StaticMethodCall Type="System.Web.Security.Roles" Method="GetAllRoles" />
</MultiKeySelector.Options>
2a. Inject your roles with a roleprovider like this
public class CompositeC1RoleProvider : RoleProvider
{
private static string[] _allRoles = new[] { "AUTHENTICATED", "ANONYMOUS" };
private string _appName;
public override string ApplicationName
{
get { return _appName; }
set { _appName = value; }
}
public override void Initialize(string name, NameValueCollection config)
{
ApplicationName = config["applicationName"];
if (String.IsNullOrEmpty(ApplicationName))
{
throw new ProviderException("Application name needs to be set");
}
base.Initialize(name, config);
}
public override void AddUsersToRoles(string[] usernames, string[] roleNames)
{
throw new NotImplementedException();
}
public override void CreateRole(string roleName)
{
throw new NotImplementedException();
}
public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
{
throw new NotImplementedException();
}
public override string[] FindUsersInRole(string roleName, string usernameToMatch)
{
return new string[0];
}
public override string[] GetAllRoles()
{
return _allRoles;
}
public override string[] GetRolesForUser(string username)
{
return new string[0];
}
public override string[] GetUsersInRole(string roleName)
{
return new string[0];
}
public override bool IsUserInRole(string username, string roleName)
{
return false;
}
public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
{
throw new NotImplementedException();
}
public override bool RoleExists(string roleName)
{
return _allRoles.Contains(roleName);
}
}
2b. Register the roleprovider in web,config
<roleManager enabled="true" defaultProvider="CompositeC1">
<providers>
<clear />
<add name="CompositeC1" type="YourNamespace.CompositeC1RoleProvider, YourAssembly" applicationName="YourApplication" />
</providers>
</roleManager>