mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
[Google Calendar]: Calendar Read Level
This commit is contained in:
parent
e1da955893
commit
869269c4e8
@ -203,7 +203,7 @@ func (widget *Widget) getCalendarIdList(srv *calendar.Service) ([]string, error)
|
|||||||
var calendarIds []string
|
var calendarIds []string
|
||||||
var pageToken string
|
var pageToken string
|
||||||
for {
|
for {
|
||||||
calendarList, err := srv.CalendarList.List().ShowHidden(false).MinAccessRole("writer").PageToken(pageToken).Do()
|
calendarList, err := srv.CalendarList.List().ShowHidden(false).MinAccessRole(widget.settings.calendarReadLevel).PageToken(pageToken).Do()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ type Settings struct {
|
|||||||
showDeclined bool `help:"Whether or not to display events you’ve declined to attend." values:"true or false" optional:"true"`
|
showDeclined bool `help:"Whether or not to display events you’ve declined to attend." values:"true or false" optional:"true"`
|
||||||
withLocation bool `help:"Whether or not to show the location of the appointment." values:"true or false"`
|
withLocation bool `help:"Whether or not to show the location of the appointment." values:"true or false"`
|
||||||
timezone string `help:"The time zone used to display calendar event times." values:"A valid TZ database time zone string" optional:"true"`
|
timezone string `help:"The time zone used to display calendar event times." values:"A valid TZ database time zone string" optional:"true"`
|
||||||
|
calendarReadLevel string `help:"The calender read level specifies level you want to read events. Default: writer " values:"reader, writer", optional: "true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
@ -47,6 +48,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
|||||||
showDeclined: ymlConfig.UBool("showDeclined", false),
|
showDeclined: ymlConfig.UBool("showDeclined", false),
|
||||||
withLocation: ymlConfig.UBool("withLocation", true),
|
withLocation: ymlConfig.UBool("withLocation", true),
|
||||||
timezone: ymlConfig.UString("timezone", ""),
|
timezone: ymlConfig.UString("timezone", ""),
|
||||||
|
calendarReadLevel: ymlConfig.UString("calendarReadLevel", "writer"),
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.colors.day = ymlConfig.UString("colors.day", "forestgreen")
|
settings.colors.day = ymlConfig.UString("colors.day", "forestgreen")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user