github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/api4/data_retention.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package api4 5 6 import ( 7 "net/http" 8 ) 9 10 func (api *API) InitDataRetention() { 11 api.BaseRoutes.DataRetention.Handle("/policy", api.ApiSessionRequired(getPolicy)).Methods("GET") 12 } 13 14 func getPolicy(c *Context, w http.ResponseWriter, r *http.Request) { 15 // No permission check required. 16 17 policy, err := c.App.GetDataRetentionPolicy() 18 if err != nil { 19 c.Err = err 20 return 21 } 22 23 w.Write([]byte(policy.ToJson())) 24 }