Skip to content

Guest shares in PROPFIND have shareType 0 instead of 4 #3592

Closed

Description

@kulmann

Describe the bug

A webdav PROPFIND returns an oc:share-types prop which lists which share types are present on a certain file/folder.

Steps to reproduce

  1. Create a guest share on a folder
  2. Do a PROPFIND on the share folder
  3. Look at the oc:share-types prop of the shared folder

Expected behavior

The list of share types on the shared folder includes 4, which encodes guest shares.

Actual behavior

The list of share types on the shared folder includes 0, which encodes a regular user share.

Activity

  1. moved this from Qualification to Backlog in OpenCloud Team Boardon Sep 24, 2026
  2. self-assigned this
    on Oct 26, 2026
  3. butonic commented on Nov 6, 2026

    @butonic
    Member

    I think the word guest is so overloaded now that we now assigned the old oc 10 share type 4 aka guest to our new guest-with-magic-links implementation. The guest accounts in oc 10 were real accounts and the CS3 api knows them as cs3user.UserType_USER_TYPE_GUEST, which is how we map them in eg.

    func CS3UserTypeToGraph(cs3type cs3user.UserType) string {
    switch cs3type {
    case cs3user.UserType_USER_TYPE_PRIMARY:
    return UserTypeMember
    case cs3user.UserType_USER_TYPE_FEDERATED:
    return UserTypeFederated
    case cs3user.UserType_USER_TYPE_GUEST:
    return UserTypeGuest
    }
    return "unknown"
    }

    That is definitely NOT what the new guest users are ... they are ghosts with NO user account in the system, bypassing all the identity management. By design ... ok, I'll not go into a rant. That is how it is.

    Urgh the numbering is all over the place ... the Grantee Type enum in the CS3 api starts at 0:

    // The type of the grantee.
    type GranteeType int32
    
    const (
    	GranteeType_GRANTEE_TYPE_INVALID GranteeType = 0
    	// This type represents an individual.
    	GranteeType_GRANTEE_TYPE_USER GranteeType = 1
    	// This type represents a group of individuals.
    	GranteeType_GRANTEE_TYPE_GROUP GranteeType = 2
    )

    which is what we write into the share-types opaque:

    	// share indicator
    	if _, ok := fieldMaskKeysMap["share-types"]; returnAllFields || ok {
    		granteeTypes, hasGuestShares := n.getGranteeTypes(ctx)
    		if len(granteeTypes) > 0 || hasGuestShares {
    			// TODO add optional property to CS3 ResourceInfo to transport grants?
    			var s strings.Builder
    			first := true
    			for _, t := range granteeTypes {
    				if !first {
    					s.WriteString(",")
    				} else {
    					first = false
    				}
    				s.WriteString(strconv.Itoa(int(t))) // <- we should probably map grant types (starting at 0) to share types (starting at 1) here
    			}
    			if hasGuestShares {
    				if !first {
    					s.WriteString(",")
    				}
    				s.WriteString(strconv.Itoa(int(conversions.ShareTypeGuest)))
    			}
    			ri.Opaque = utils.AppendPlainToOpaque(ri.Opaque, "share-types", s.String())
    		}
    	}

    so here we actually mix grant types and share types.

    The oc 10 share types are (owncloud/core lib/private/Share/Constants.php, core/js/share.js): USER=0, GROUP=1, LINK=3, GUEST=4, CONTACT=5, REMOTE=6, REMOTE_GROUP=7. In those terms conversions.ShareTypeGuest = 4 is the oc10 guest value

    Luckily we could argue that CS3 users with UserType_USER_TYPE_GUEST are considered users in oc10 and that we now change the word guest for our new guest-with-magic-links guests.

    Still this will make it impossible to differentiate between the two kinds of share types:

    • Shares to CS3 Users with UserType_USER_TYPE_GUEST
    • Shares to our new guest shares

    Can we rename the ShareTypeGuest to ShareTypeEmail? with id 4? That would align with the old 4 in oc10 as well as the nextcloud share type EMAIL=4. It would also future prevent collisions with UserType_USER_TYPE_GUEST users.

    The word guest is overloaded. We need to have a specific technical name for the 'new' guest to differentiate them from 'cs3' guests.

  4. butonic commented on Nov 6, 2026

    @butonic
    Member

    And in the graph api it should probably also appear as 'email' or 'mail': opencloud-eu/libre-graph-api#83 (comment)

  5. maki5 commented on Nov 6, 2026

    @maki5
    Contributor

    in my opinion it makes sense, I'm just a bit confused of the name emai/mail as a suggestion we can use something like guest_email. But I would like to have other opinions as well

  6. moved this from Prio <= 3 to Needs Review in OpenCloud Team Boardon Nov 18, 2026
  7. moved this from Needs Review to Done in OpenCloud Team Boardon Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions