icaruseu / mom-ca

Monasterium.net (http://www.monasterium.net/mom) - repository and collaborative archive
https://github.com/icaruseu/mom-ca/wiki
GNU General Public License v3.0
17 stars 11 forks source link

my-charter preview throws XRX error in case of non authenticated request #733

Open GVogeler opened 6 years ago

GVogeler commented 6 years ago

When calling a private charter in the preview MOM-CA currently throws an XRX-error:

>  The actual return type does not match the sequence type declared in the function's signature: charter:charterid(xs:string?) xs:string. Expected cardinality: exactly one, got 0. [at line 161, column 26, source: String]
In function:
    charter:charterid(xs:string?) [25:207:/db/XRX.live/mom/app/charter/charter.xqm]

It would be nice to have a standard authentication request instead ("This charter is private. Please log in to ..."), although the case is not very often, as it usually only occurs in project cooperations where URLs are sent around and tested without being logged in.

GVogeler commented 6 years ago

investigation suggestion: add <xrx:auth> to my-charter widet? e.g. https://github.com/icaruseu/mom-ca/blob/20dd2b7457d6a30561ef03f29086dbfc9bb999d2/my/XRX/src/mom/app/mom/widget/my-archive.widget.xml#L46

GVogeler commented 6 years ago

adding <xrx:auth> to the main <xrx:view> in charter.widget.xml (from with my-charter.widget.xml inherits is main view) does not change anything.

StephanMa commented 6 years ago

I think, that the charter with this delivered atom:id couldn't be found...

GVogeler commented 6 years ago

OK: As the atom:id exists in the xrx:user-space and after logging in mom-ca finds it (e.g. http://monasterium.net/mom/7ce18f90-1428-4786-8f92-dcc53068a079/21d9550c-f4a8-4c67-ace0-3386fbd143c3/my-charter), we will have to check how my-charter.widget.xml finds the XML: https://github.com/icaruseu/mom-ca/blob/master/my/XRX/src/mom/app/charter/widget/my-charter.widget.xml#L76-L98 seems to be a good candidate for this. Investigation suggestion: what does this return, when a user is not logged in?