enhancement: show permission actions if no role is set when converting space permissions to libregraph permissions

This commit is contained in:
Florian Schade
2024-08-21 16:50:34 +02:00
parent 4f2678351d
commit 43ba95190f
3 changed files with 56 additions and 1 deletions
+6 -1
View File
@@ -208,6 +208,12 @@ func (g BaseGraphService) cs3SpacePermissionsToLibreGraph(ctx context.Context, s
}
}
// if there is no role, we need to set the actions as a fallback
// this could happen if a role is disabled or unknown
if !p.HasRoles() {
p.SetLibreGraphPermissionsActions(unifiedrole.CS3ResourcePermissionsToLibregraphActions(perm))
}
permissions = append(permissions, p)
}
return permissions
@@ -398,7 +404,6 @@ func (g BaseGraphService) cs3UserShareToPermission(ctx context.Context, share *c
if share.GetCtime() != nil {
perm.SetCreatedDateTime(cs3TimestampToTime(share.GetCtime()))
}
// fixMe: should we use all roles?
role := unifiedrole.CS3ResourcePermissionsToRole(
unifiedrole.GetRoles(unifiedrole.RoleFilterIDs(g.config.UnifiedRoles.AvailableRoles...)),
share.GetPermissions().GetPermissions(),