Skip to content

Commit

Permalink
Fix OCS public link share update values logic (#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry committed Jul 3, 2020
1 parent 07868d7 commit 223eaed
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 147 deletions.
3 changes: 2 additions & 1 deletion internal/http/services/owncloud/ocs/conversions/main.go
Expand Up @@ -361,6 +361,7 @@ func publicSharePermissions2OCSPermissions(sp *link.PublicSharePermissions) Perm
}

// TODO sort out mapping, this is just a first guess
// public link permissions to OCS permissions
func Permissions2OCSPermissions(p *provider.ResourcePermissions) Permissions {
permissions := PermissionInvalid
if p != nil {
Expand All @@ -386,7 +387,7 @@ func Permissions2OCSPermissions(p *provider.ResourcePermissions) Permissions {
// timestamp is assumed to be UTC ... just human readable ...
// FIXME and ambiguous / error prone because there is no time zone ...
func timestampToExpiration(t *types.Timestamp) string {
return time.Unix(int64(t.Seconds), int64(t.Nanos)).Format("2006-01-02 15:05:05")
return time.Unix(int64(t.Seconds), int64(t.Nanos)).UTC().Format("2006-01-02 15:05:05")
}

const (
Expand Down
Expand Up @@ -61,7 +61,7 @@ func (p Permissions) Contain(other Permissions) bool {
return p&other != 0
}

// Permissions2Role performs permission conversions
// Permissions2Role performs permission conversions for user and federated shares
func Permissions2Role(p Permissions) string {
role := RoleLegacy
if p.Contain(PermissionRead) {
Expand Down

0 comments on commit 223eaed

Please sign in to comment.