]> BookStack Code Mirror - bookstack/commitdiff
Merge pull request #103 from ssddanbrown/add_role_view_permissions
authorDan Brown <redacted>
Sun, 1 May 2016 21:47:22 +0000 (22:47 +0100)
committerDan Brown <redacted>
Sun, 1 May 2016 21:47:22 +0000 (22:47 +0100)
Overhauled permission system and stripped migrations of most app code to reduce future breakages. Closes #101.

1  2 
resources/views/settings/index.blade.php

index 7c1ec59bfd44c6189c98b0313aa64230039c834e,4697d34674d4d299a13aa81538cb6f76e0e72b34..ce7a8d5d14acec3a0d531e0c731c759ffe08ed14
                  </div>
                  <div class="form-group">
                      <label>Allow public viewing?</label>
 -                    <toggle-switch name="setting-app-public" value="{{ setting('app-public') }}"></toggle-switch>
 +                    <div toggle-switch name="setting-app-public" value="{{ setting('app-public') }}"></div>
                  </div>
                  <div class="form-group">
                      <label>Enable higher security image uploads?</label>
                      <p class="small">For performance reasons, all images are public by default, This option adds a random, hard-to-guess characters in front of image names. Ensure directory indexes are not enabled to prevent easy access.</p>
 -                    <toggle-switch name="setting-app-secure-images" value="{{ setting('app-secure-images') }}"></toggle-switch>
 +                    <div toggle-switch name="setting-app-secure-images" value="{{ setting('app-secure-images') }}"></div>
                  </div>
                  <div class="form-group">
                      <label for="setting-app-editor">Page editor</label>
              <div class="col-md-6">
                  <div class="form-group">
                      <label for="setting-registration-enabled">Allow registration?</label>
 -                    <toggle-switch name="setting-registration-enabled" value="{{ setting('registration-enabled') }}"></toggle-switch>
 +                    <div toggle-switch name="setting-registration-enabled" value="{{ setting('registration-enabled') }}"></div>
                  </div>
                  <div class="form-group">
                      <label for="setting-registration-role">Default user role after registration</label>
                      <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
-                         @foreach(\BookStack\Role::all() as $role)
-                             <option value="{{$role->id}}"
+                         @foreach(\BookStack\Role::visible() as $role)
+                             <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
                                      @if(setting('registration-role', \BookStack\Role::first()->id) == $role->id) selected @endif
                                      >
                                  {{ $role->display_name }}
@@@ -78,7 -78,7 +78,7 @@@
                  <div class="form-group">
                      <label for="setting-registration-confirmation">Require email confirmation?</label>
                      <p class="small">If domain restriction is used then email confirmation will be required and the below value will be ignored.</p>
 -                    <toggle-switch name="setting-registration-confirmation" value="{{ setting('registration-confirmation') }}"></toggle-switch>
 +                    <div toggle-switch name="setting-registration-confirmation" value="{{ setting('registration-confirmation') }}"></div>
                  </div>
              </div>
              <div class="col-md-6">