Tiefensuche bei IsPublic
This commit is contained in:
@@ -237,8 +237,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
public bool CanShareEdit
|
||||
{
|
||||
get => ParentFolderOid < 0
|
||||
&& BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare)
|
||||
get => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare)
|
||||
&& Creator?.EmployeeOid is long owner
|
||||
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid;
|
||||
}
|
||||
|
||||
@@ -2867,10 +2867,33 @@ WHERE sc.Billable = 1 and sr.StartDate >= '{0:yyyy-MM-dd}' and sr.StartDate < '{
|
||||
|
||||
var criteria = GetAiPromptbausteineFolderRoot(aiActionType);
|
||||
|
||||
criteria.Add(Restrictions.Eq(nameof(AiPromptbausteinFolder.IsPublic), true));
|
||||
//criteria.Add(Restrictions.Eq(nameof(AiPromptbausteinFolder.IsPublic), true));
|
||||
criteria.Add(Restrictions.Not(Restrictions.Eq(nameof(AiPromptbausteinFolder.CreatorOid), emp_oid)));
|
||||
|
||||
return criteria.List<AiPromptbausteinFolder>();
|
||||
var list = criteria.List<AiPromptbausteinFolder>();
|
||||
|
||||
var rtn_list = new List<AiPromptbausteinFolder>();
|
||||
|
||||
foreach (var candidate in list)
|
||||
{
|
||||
findPublicFolderDFS(candidate, rtn_list);
|
||||
}
|
||||
|
||||
return rtn_list;
|
||||
}
|
||||
|
||||
private void findPublicFolderDFS(AiPromptbausteinFolder current, List<AiPromptbausteinFolder> folders)
|
||||
{
|
||||
if (current.IsPublic)
|
||||
{
|
||||
folders.Add(current);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var subFolder in current.SubFolders)
|
||||
{
|
||||
findPublicFolderDFS(subFolder, folders);
|
||||
}
|
||||
}
|
||||
|
||||
private ICriteria GetAiPromptbausteineFolderRoot(AiActionType? aiActionType = null)
|
||||
|
||||
Reference in New Issue
Block a user