Private
Public Access
1
0

rules rules rules

This commit is contained in:
Sander Roosendaal
2020-01-16 22:01:54 +01:00
parent ae366b2f17
commit c186895e7a
2 changed files with 21 additions and 2 deletions

View File

@@ -243,7 +243,7 @@ def can_add_workout_member(user,rower):
if user == rower.user:
return True
# only below tested - need test user == rower.user
return isplanmember(user) and user.rower in rower.get_coaches()
return is_coach(user) and user.rower in rower.get_coaches()
# check if user can plan for the rower
@rules.predicate
@@ -324,7 +324,6 @@ def is_workout_user(user,workout):
def can_view_workout(user,workout):
if workout.privacy != 'private':
return True
# below not tested
return user.rower == workout.user
can_change_workout = is_workout_user