Skip to content
Permalink
Browse files

Fixing issue where Element Tree generation require an active user. Ma…

…nifested itself by failing to init Page Tree on first load after setup.
  • Loading branch information...
mawtex committed Jul 4, 2019
1 parent 566caaf commit 04bf53be915a33f71f31f31d8911b12edf1541bd
Showing with 20 additions and 13 deletions.
  1. +20 −13 Composite/Data/DynamicTypes/DataTypeDescriptorFormsHelper.cs
@@ -265,27 +265,34 @@ private static object GetDefaultValue(Type type)

private static Dictionary<string, string> GetAvailablePublishingFlowTransitions(EntityToken entityToken)
{
var transitionNames = new Dictionary<string, string>
if(UserValidationFacade.IsLoggedIn())
{
var transitionNames = new Dictionary<string, string>
{
{GenericPublishProcessController.Draft, LocalizationFiles.Composite_Management.PublishingStatus_draft},
{GenericPublishProcessController.AwaitingApproval, LocalizationFiles.Composite_Management.PublishingStatus_awaitingApproval}
};

var username = UserValidationFacade.GetUsername();
var userPermissionDefinitions = PermissionTypeFacade.GetUserPermissionDefinitions(username);
var userGroupPermissionDefinition = PermissionTypeFacade.GetUserGroupPermissionDefinitions(username);
var currentPermissionTypes = PermissionTypeFacade.GetCurrentPermissionTypes(UserValidationFacade.GetUserToken(), entityToken, userPermissionDefinitions, userGroupPermissionDefinition);
foreach (var permissionType in currentPermissionTypes)
{
if (GenericPublishProcessController.AwaitingPublicationActionPermissionType.Contains(permissionType))
var username = UserValidationFacade.GetUsername();
var userPermissionDefinitions = PermissionTypeFacade.GetUserPermissionDefinitions(username);
var userGroupPermissionDefinition = PermissionTypeFacade.GetUserGroupPermissionDefinitions(username);
var currentPermissionTypes = PermissionTypeFacade.GetCurrentPermissionTypes(UserValidationFacade.GetUserToken(), entityToken, userPermissionDefinitions, userGroupPermissionDefinition);
foreach (var permissionType in currentPermissionTypes)
{
transitionNames.Add(GenericPublishProcessController.AwaitingPublication,
LocalizationFiles.Composite_Management.PublishingStatus_awaitingPublication);
break;
if (GenericPublishProcessController.AwaitingPublicationActionPermissionType.Contains(permissionType))
{
transitionNames.Add(GenericPublishProcessController.AwaitingPublication,
LocalizationFiles.Composite_Management.PublishingStatus_awaitingPublication);
break;
}
}
}

return transitionNames;
return transitionNames;
}
else
{
return new Dictionary<string, string>();
}
}


0 comments on commit 04bf53b

Please sign in to comment.
You can’t perform that action at this time.