Skip to content

Commit

Permalink
Added file self links for guests
Browse files Browse the repository at this point in the history
  • Loading branch information
rhinoman committed Nov 26, 2015
1 parent ae2ad0b commit 8aeb875
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
7 changes: 2 additions & 5 deletions wikis/wiki_service/file_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit 8aeb875

Please sign in to comment.