prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  events not editable for groupmembers
  group member CAN edit a project but CANNOT an event related to the project. 403 error.
  
  </issue>
  <code>
  [start of meinberlin/apps/offlineevents/rules.py]
  1 import rules
  2 from rules.predicates import is_superuser
  3 
  4 from adhocracy4.modules import predicates as module_predicates
  5 from adhocracy4.organisations.predicates import is_initiator
  6 from adhocracy4.projects.predicates import is_moderator
  7 
  8 rules.add_perm(
  9     'meinberlin_offlineevents.list_offlineevent',
  10     is_superuser | is_initiator | is_moderator
  11 )
  12 
  13 rules.add_perm(
  14     'meinberlin_offlineevents.view_offlineevent',
  15     module_predicates.is_allowed_view_item
  16 )
  17 
  18 rules.add_perm(
  19     'meinberlin_offlineevents.add_offlineevent',
  20     is_superuser | is_initiator | is_moderator
  21 )
  22 
  23 rules.add_perm(
  24     'meinberlin_offlineevents.change_offlineevent',
  25     is_superuser | is_initiator | is_moderator
  26 )
  27
  [end of meinberlin/apps/offlineevents/rules.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/meinberlin/apps/offlineevents/rules.py b/meinberlin/apps/offlineevents/rules.py
  --- a/meinberlin/apps/offlineevents/rules.py
  +++ b/meinberlin/apps/offlineevents/rules.py
  @@ -4,10 +4,11 @@
   from adhocracy4.modules import predicates as module_predicates
   from adhocracy4.organisations.predicates import is_initiator
   from adhocracy4.projects.predicates import is_moderator
  +from adhocracy4.projects.predicates import is_prj_group_member
   
   rules.add_perm(
       'meinberlin_offlineevents.list_offlineevent',
  -    is_superuser | is_initiator | is_moderator
  +    is_superuser | is_initiator | is_moderator | is_prj_group_member
   )
   
   rules.add_perm(
  @@ -17,10 +18,10 @@
   
   rules.add_perm(
       'meinberlin_offlineevents.add_offlineevent',
  -    is_superuser | is_initiator | is_moderator
  +    is_superuser | is_initiator | is_moderator | is_prj_group_member
   )
   
   rules.add_perm(
       'meinberlin_offlineevents.change_offlineevent',
  -    is_superuser | is_initiator | is_moderator
  +    is_superuser | is_initiator | is_moderator | is_prj_group_member
   )
  
verification_info: {"golden_diff": "diff --git a/meinberlin/apps/offlineevents/rules.py b/meinberlin/apps/offlineevents/rules.py\n--- a/meinberlin/apps/offlineevents/rules.py\n+++ b/meinberlin/apps/offlineevents/rules.py\n@@ -4,10 +4,11 @@\n from adhocracy4.modules import predicates as module_predicates\n from adhocracy4.organisations.predicates import is_initiator\n from adhocracy4.projects.predicates import is_moderator\n+from adhocracy4.projects.predicates import is_prj_group_member\n \n rules.add_perm(\n     'meinberlin_offlineevents.list_offlineevent',\n-    is_superuser | is_initiator | is_moderator\n+    is_superuser | is_initiator | is_moderator | is_prj_group_member\n )\n \n rules.add_perm(\n@@ -17,10 +18,10 @@\n \n rules.add_perm(\n     'meinberlin_offlineevents.add_offlineevent',\n-    is_superuser | is_initiator | is_moderator\n+    is_superuser | is_initiator | is_moderator | is_prj_group_member\n )\n \n rules.add_perm(\n     'meinberlin_offlineevents.change_offlineevent',\n-    is_superuser | is_initiator | is_moderator\n+    is_superuser | is_initiator | is_moderator | is_prj_group_member\n )\n", "issue": "events not editable for groupmembers\ngroup member CAN edit a project but CANNOT an event related to the project. 403 error.\n", "before_files": [{"content": "import rules\nfrom rules.predicates import is_superuser\n\nfrom adhocracy4.modules import predicates as module_predicates\nfrom adhocracy4.organisations.predicates import is_initiator\nfrom adhocracy4.projects.predicates import is_moderator\n\nrules.add_perm(\n    'meinberlin_offlineevents.list_offlineevent',\n    is_superuser | is_initiator | is_moderator\n)\n\nrules.add_perm(\n    'meinberlin_offlineevents.view_offlineevent',\n    module_predicates.is_allowed_view_item\n)\n\nrules.add_perm(\n    'meinberlin_offlineevents.add_offlineevent',\n    is_superuser | is_initiator | is_moderator\n)\n\nrules.add_perm(\n    'meinberlin_offlineevents.change_offlineevent',\n    is_superuser | is_initiator | is_moderator\n)\n", "path": "meinberlin/apps/offlineevents/rules.py"}]}