(ctx context.Context)
| 148 | var rightsKey rightsKeyType |
| 149 | |
| 150 | func fromContext(ctx context.Context) (*Rights, bool) { |
| 151 | if rights, ok := ctx.Value(rightsKey).(*Rights); ok { |
| 152 | return rights, true |
| 153 | } |
| 154 | return &Rights{}, false |
| 155 | } |
| 156 | |
| 157 | // NewContext returns a derived context with the given rights. |
| 158 | func NewContext(ctx context.Context, rights *Rights) context.Context { |
no test coverage detected