From 8aeb875f05f9331904739129623bf2b9c97ec734 Mon Sep 17 00:00:00 2001 From: jcadam Date: Thu, 26 Nov 2015 07:11:12 -0500 Subject: [PATCH] Added file self links for guests --- scripts/build_all.sh | 2 +- wikis/wiki_service/file_controller.go | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/build_all.sh b/scripts/build_all.sh index cef60aa4..0d3e3325 100755 --- a/scripts/build_all.sh +++ b/scripts/build_all.sh @@ -7,7 +7,7 @@ CC=gcc export CC -VERSION=0.2.0-alpha +VERSION=0.2.1-alpha ARCH=`uname -p` OS=`uname` BUILDNAME=wikifeat_${VERSION}.${OS}-${ARCH} diff --git a/wikis/wiki_service/file_controller.go b/wikis/wiki_service/file_controller.go index d0538d68..d36348b9 100644 --- a/wikis/wiki_service/file_controller.go +++ b/wikis/wiki_service/file_controller.go @@ -421,12 +421,9 @@ func (fc FileController) genFileRecordLinks(userRoles []string, wikiDb string, uri string) fileLinks { links := fileLinks{} admin := util.HasRole(userRoles, AdminRole(wikiDb)) - read := util.HasRole(userRoles, ReadRole(wikiDb)) write := util.HasRole(userRoles, WriteRole(wikiDb)) - if admin || read || write { - links.Self = &HatLink{Href: uri, Method: "GET"} - links.GetAttachment = &HatLink{Href: uri + "/content", Method: "GET"} - } + links.Self = &HatLink{Href: uri, Method: "GET"} + links.GetAttachment = &HatLink{Href: uri + "/content", Method: "GET"} if admin || write { links.Update = &HatLink{Href: uri, Method: "PUT"} links.Delete = &HatLink{Href: uri, Method: "DELETE"}