mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-04 02:31:14 -06:00
[server][core] Fix fullResourceQuery for root node
This commit is contained in:
@@ -75,7 +75,7 @@ func setupUserAddCommand() *cobra.Command {
|
||||
var u user.User
|
||||
var home fs.Resource
|
||||
if homePath != "" {
|
||||
f = common.RootFileSystem().WithDb(db)
|
||||
f = f.WithDb(db)
|
||||
var err error
|
||||
home, err = f.CreateResourceByPath(homePath, uuid.Nil, true, true, fs.ResourceBindConflictResolutionEnsure)
|
||||
if err != nil {
|
||||
|
||||
@@ -22,7 +22,7 @@ const fullResourceQuery = `SELECT r.*,
|
||||
(SELECT ` + publinkFieldsQuery + ` FROM publinks l WHERE l.root = r.id) AS links,
|
||||
CASE WHEN COALESCE(p.permissions[@username::TEXT]::INTEGER, 0) <> 0 THEN p.id ELSE NULL END AS visible_parent,
|
||||
COALESCE(p.permissions, '{}'::JSONB) AS inherited_permissions
|
||||
FROM resources r JOIN resources p ON p.id = r.parent
|
||||
FROM resources r LEFT JOIN resources p ON p.id = r.parent
|
||||
`
|
||||
|
||||
func selectResourceTree(id uuid.UUID, excludeTreeRoot, includeDeleted, includeLinks bool, extraCols ...string) (exp.IdentifierExpression, exp.AliasedExpression, *goqu.SelectDataset) {
|
||||
|
||||
Reference in New Issue
Block a user