|
|
|
|
@ -46,4 +46,23 @@ class DataStore: ObservableObject { |
|
|
|
|
self.objectWillChange.send() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var globalRights: UserRight { |
|
|
|
|
if let _ = Guard.main.currentPlan { |
|
|
|
|
return .creation |
|
|
|
|
} |
|
|
|
|
if let user = self.user, user.club_id != nil { |
|
|
|
|
if user.umpire_code != nil { |
|
|
|
|
return .creation |
|
|
|
|
} else { |
|
|
|
|
return .edition |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO what are the rules when testing the app? |
|
|
|
|
// scenario example: one cancelled tournament |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return .none |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|