HasAdministrator returns true if the given identity is included in the administrator.
(i identity.Interface)
| 37 | |
| 38 | // HasAdministrator returns true if the given identity is included in the administrator. |
| 39 | func (snap *Snapshot) HasAdministrator(i identity.Interface) bool { |
| 40 | for admin, _ := range snap.Administrator { |
| 41 | if admin.Id() == i.Id() { |
| 42 | return true |
| 43 | } |
| 44 | } |
| 45 | return false |
| 46 | } |
| 47 | |
| 48 | // Now, we will not edit this configuration directly. Instead, we are going to apply "operations" on it. |
| 49 | // Those are the ones that will be stored and shared. Doing things that way allow merging concurrent editing |