<commit_before>%section#banner
  .row
    .medium-12.columns
      %h2 Using the codebar application

      %h3 Managing admin privileges

      %p To manage roles, we use the Rolify gem. At the moment, the only way to add and remove privileges is through Rails console. There are three types of special roles: chapter organisers, meeting organisers and admins.

      %p Chapter organisers can create and modify sponsors and workshops only for chapters that they are permissioned. To make a member into an organiser of a chapter,

      = raw CommonMarker.render_html("`Member.find(:id).add_role(:organiser, Chapter.find(:id))`")

      %p Meeting organisers can create and modify monthlies. To make a member into a meeting organiser,

      = raw CommonMarker.render_html("`Member.find(:id).add_role(:organiser, Meeting`")

      %p Admins can create and modify sponsors, workshops, meetings and events across all chapters. Admins can also create new chapters. To permission a member as an admin,

      = raw CommonMarker.render_html("`Member.find(:id).add_role(:admin)`")

      %p Similarly, to remove privileges,

      = raw CommonMarker.render_html("`Member.find(:id).remove_role(:organiser, Chapter.find(:id))`")

      = raw CommonMarker.render_html("`Member.find(:id).remove_role(:organiser, Meeting)`")

      = raw CommonMarker.render_html("`Member.find(:id).remove_role(:admin)`")

      %p You can also check if a member has permissions. The second argument for organiser roles can be a specific chapter or :any.

      = raw CommonMarker.render_html("`Member.find(:id).has_role?(:organiser, :any)`")

      %p You can query all of the organisers from a Chapter as well.

      = raw CommonMarker.render_html("`Member.with_role(:organiser, Chapter.find(:13))`")<commit_msg>Simplify Markdown rendering on Haml files<commit_after>%section#banner
  .row
    .medium-12.columns
      %h2 Using the codebar application

      %h3 Managing admin privileges

      %p To manage roles, we use the Rolify gem. At the moment, the only way to add and remove privileges is through Rails console. There are three types of special roles: chapter organisers, meeting organisers and admins.

      %p Chapter organisers can create and modify sponsors and workshops only for chapters that they are permissioned. To make a member into an organiser of a chapter,

      = dot_markdown("`Member.find(:id).add_role(:organiser, Chapter.find(:id))`")

      %p Meeting organisers can create and modify monthlies. To make a member into a meeting organiser,

      = dot_markdown("`Member.find(:id).add_role(:organiser, Meeting`")

      %p Admins can create and modify sponsors, workshops, meetings and events across all chapters. Admins can also create new chapters. To permission a member as an admin,

      = dot_markdown("`Member.find(:id).add_role(:admin)`")

      %p Similarly, to remove privileges,

      = dot_markdown("`Member.find(:id).remove_role(:organiser, Chapter.find(:id))`")

      = dot_markdown("`Member.find(:id).remove_role(:organiser, Meeting)`")

      = dot_markdown("`Member.find(:id).remove_role(:admin)`")

      %p You can also check if a member has permissions. The second argument for organiser roles can be a specific chapter or :any.

      = dot_markdown("`Member.find(:id).has_role?(:organiser, :any)`")

      %p You can query all of the organisers from a Chapter as well.

      = dot_markdown("`Member.with_role(:organiser, Chapter.find(:13))`")
{'fraction_non_alphanumeric': 0.10299194476409666, 'fraction_numerical': 0.0034522439585730723, 'mean_word_length': 3.9956896551724137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '806992', 'n_tokens_mistral': 1002, 'n_tokens_neox': 941, 'n_words': 360}