Menu

#119 How to give permissions to level 1 users to different sections?

open
None
1
2023-02-09
2023-02-08
William
No

Hello ! I am implementing MRBS in my project and I want to make level 1 users have access to create rooms

Discussion

  • Campbell Morrison

    Which version of MRBS are you running?

     
    • William

      William - 2023-02-08

      mrbs-1.11.0

       
  • Campbell Morrison

    You'll need to

    (1) Edit the function get_page_level() in mrbs_auth.inc so that the line case 'edit_room_handler.php': appears further up and produces the result 1 instead of 2.

    (2) Edit edit_room.php and replace all occurrences of is_admin() by true.

     
    • William

      William - 2023-02-08

      It does not work

       
    • William

      William - 2023-02-08

      do you know another solution?

       
  • Campbell Morrison

    Can you post your versions of those two files here please?

     
    • William

      William - 2023-02-08

      they are there

       
  • Campbell Morrison

    Thanks. How doesn't it work? What happens?

     
    • William

      William - 2023-02-08

      I have a level 1 user.
      You cannot create rooms, you can only view them.

      I'm trying to allow level 1 users to create rooms as well as view

       
  • Campbell Morrison

    You will also need to edit admin.php and change is_admin() to true in the places where you want to give the level 1 users rights.

     
    😄
    1
    • William

      William - 2023-02-08

      okay :)

       

      Last edit: William 2023-02-08
    • William

      William - 2023-02-08

      But when adding a new area it doesn't allow me, the same goes for adding a new room

       

      Last edit: William 2023-02-08
  • Campbell Morrison

    Is this is a separate requirement to https://sourceforge.net/p/mrbs/patches/120/ ? Or are they one and the same?

     
    • William

      William - 2023-02-08

      is different

       
      • Campbell Morrison

        Are they two different sites?

         
        • William

          William - 2023-02-08

          yes

           
  • Campbell Morrison

    the same goes for adding a new room

    Sorry, you'll also need to shift the lines for add.php and del.php in get_page_level() from 2 to 1.

     
  • Campbell Morrison

    But when adding a new area it doesn't allow me

    You only asked for rooms! To create and edit areas you'll also need to shift the lines for edit_area.php and edit_area_handler.php in get_page_level() from 2 to 1.

     
    • William

      William - 2023-02-09

      Thank you very much for the help