Apply is the function that makes changes on the snapshot
(snapshot *Snapshot)
| 131 | |
| 132 | // Apply is the function that makes changes on the snapshot |
| 133 | func (aa *AddAdministrator) Apply(snapshot *Snapshot) { |
| 134 | // check that we are allowed to change the config ... or if there is no admin yet |
| 135 | if !snapshot.HasAdministrator(aa.Author()) && len(snapshot.Administrator) != 0 { |
| 136 | return |
| 137 | } |
| 138 | for _, toAdd := range aa.ToAdd { |
| 139 | snapshot.Administrator[toAdd] = struct{}{} |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | // RemoveAdministrator is an operation to remove an administrator from the set |
| 144 | type RemoveAdministrator struct { |
nothing calls this directly
no test coverage detected