v0.11.1 - Fixed roles and permissions
This commit is contained in:
parent
d7bfdaebf6
commit
4a64d49902
|
@ -22,7 +22,7 @@ class UserController extends Controller
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware([ "auth" ])->only("logout");
|
$this->middleware([ "auth" ])->only(["accountupdate", "accountedit", "accounteditpass", "account", "logout"]);
|
||||||
|
|
||||||
$this->middleware([ "guest" ])->only("login");
|
$this->middleware([ "guest" ])->only("login");
|
||||||
$this->middleware([ "lang" ])->except(["login", "showLogin", "showForgot", "forgot"]);
|
$this->middleware([ "lang" ])->except(["login", "showLogin", "showForgot", "forgot"]);
|
||||||
|
@ -31,8 +31,6 @@ class UserController extends Controller
|
||||||
$this->middleware([ "check.auth:user.create" ])->only("create");
|
$this->middleware([ "check.auth:user.create" ])->only("create");
|
||||||
$this->middleware([ "check.auth:user.edit" ])->only(["edit", "update"]);
|
$this->middleware([ "check.auth:user.edit" ])->only(["edit", "update"]);
|
||||||
$this->middleware([ "check.auth:user.delete" ])->only("delete");
|
$this->middleware([ "check.auth:user.delete" ])->only("delete");
|
||||||
|
|
||||||
$this->middleware([ "check.auth:ownuser.edit" ])->only(["accountupdate", "accountedit", "accounteditpass", "account"]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,6 +12,8 @@ class UserEventController extends Controller
|
||||||
{
|
{
|
||||||
$this->middleware(["auth"]);
|
$this->middleware(["auth"]);
|
||||||
$this->middleware(["lang"]);
|
$this->middleware(["lang"]);
|
||||||
|
$this->middleware([ "check.auth:userevent.create" ])->only("create");
|
||||||
|
$this->middleware([ "check.auth:userevent.delete" ])->only("destroy");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
|
|
|
@ -21,7 +21,6 @@ class PermissionSeeder extends Seeder
|
||||||
"user.show" => "Shows another user profile.",
|
"user.show" => "Shows another user profile.",
|
||||||
"user.edit" => "Allows editing of other users.",
|
"user.edit" => "Allows editing of other users.",
|
||||||
"user.delete" => "Allows deleting of other users.",
|
"user.delete" => "Allows deleting of other users.",
|
||||||
"ownuser.edit" => "Allows editing of your own user",
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The EVENT specific permissions
|
* The EVENT specific permissions
|
||||||
|
@ -30,6 +29,8 @@ class PermissionSeeder extends Seeder
|
||||||
"event.show" => "Shows a specific event",
|
"event.show" => "Shows a specific event",
|
||||||
"event.edit" => "Allows editing of events",
|
"event.edit" => "Allows editing of events",
|
||||||
"event.delete" => "Allows deletion of events",
|
"event.delete" => "Allows deletion of events",
|
||||||
|
"userevent.create" => "Allows participation in an event",
|
||||||
|
"userevent.delete" => "Allows removing participation in an event",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CONTACT specific permissions
|
* The CONTACT specific permissions
|
||||||
|
@ -44,7 +45,6 @@ class PermissionSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
"feedback.create" => "Creates a new feedback message",
|
"feedback.create" => "Creates a new feedback message",
|
||||||
"feedback.show" => "Shows a specific feedback message",
|
"feedback.show" => "Shows a specific feedback message",
|
||||||
"feedback.edit" => "allows editing of feedback messages",
|
|
||||||
"feedback.delete" => "allows deletion of feedback messages",
|
"feedback.delete" => "allows deletion of feedback messages",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -46,8 +46,9 @@ class RoleSeeder extends Seeder
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "washing.machine.reservation.create")->first());
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "washing.machine.reservation.create")->first());
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "washing.machine.reservation.delete")->first());
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "washing.machine.reservation.delete")->first());
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "washing.machine.reservation.show")->first());
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "washing.machine.reservation.show")->first());
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "ownuser.edit")->first());
|
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "event.show")->first());
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "event.show")->first());
|
||||||
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "userevent.create")->first());
|
||||||
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "userevent.delete")->first());
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "guides.show")->first());
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "guides.show")->first());
|
||||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "news.show")->first());
|
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "news.show")->first());
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-2" style="width: 100%;">
|
<div class="mb-2" style="width: 100%;">
|
||||||
<button id="kontoButton" type="button" class="btn btn-sde-blue mb-1 mr-1" value="konto">Konto rettigheder</button>
|
<button id="kontoButton" type="button" class="btn btn-sde-blue mb-1 mr-1" value="konto">App rettigheder</button>
|
||||||
<button id="adminButton" type="button" class="btn btn-sde-blue mb-1">Admin rettigheder</button>
|
<button id="adminButton" type="button" class="btn btn-sde-blue mb-1">Admin rettigheder</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -47,18 +47,11 @@
|
||||||
<small class="form-text text-muted">Her kan alle basale rettigheder for appens forbrugere slås til eller fra.</small>
|
<small class="form-text text-muted">Her kan alle basale rettigheder for appens forbrugere slås til eller fra.</small>
|
||||||
<table class="tbl mb-2">
|
<table class="tbl mb-2">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Konto</th>
|
<th>App-side</th>
|
||||||
<th>Beskrivelse</th>
|
<th>Beskrivelse kan fjernes?</th>
|
||||||
<th>Create</th>
|
<th>Opret/Tilmeld</th>
|
||||||
<th>Read</th>
|
<th>Se</th>
|
||||||
<th>Delete</th>
|
<th>Slet/Afmeld</th>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Konto</td>
|
|
||||||
<td><p>Egen bruger</p></td>
|
|
||||||
<td></td>
|
|
||||||
<td><input type="checkbox" name="value[]" value="ownuser.edit"></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Nyheder</td>
|
<td>Nyheder</td>
|
||||||
|
@ -77,9 +70,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>Aktiviteter</td>
|
<td>Aktiviteter</td>
|
||||||
<td><p>Empty</p></td>
|
<td><p>Empty</p></td>
|
||||||
<td></td>
|
<td>//TEST<input id="EventCAccount" type="checkbox" name="value[]" value="userevent.create"></td>
|
||||||
<td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show"></td>
|
<td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show"></td>
|
||||||
<td></td>
|
<td>//TEST<input id="EventDAccount" type="checkbox" name="value[]" value="userevent.delete"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Reservationer</td>
|
<td>Reservationer</td>
|
||||||
|
@ -106,7 +99,7 @@
|
||||||
<td>Feedback</td>
|
<td>Feedback</td>
|
||||||
<td>Empty</td>
|
<td>Empty</td>
|
||||||
<td><input id="FeedbackCAccount" onclick="if ($('#FeedbackC').prop('checked') == false) $('#FeedbackC').prop('checked', true); else $('#FeedbackC').prop('checked', false);" type="checkbox" name="value[]" value="feedback.create"></td>
|
<td><input id="FeedbackCAccount" onclick="if ($('#FeedbackC').prop('checked') == false) $('#FeedbackC').prop('checked', true); else $('#FeedbackC').prop('checked', false);" type="checkbox" name="value[]" value="feedback.create"></td>
|
||||||
<td><input id="FeedbackRAccount" onclick="if ($('#FeedbackR').prop('checked') == false) $('#FeedbackR').prop('checked', true); else $('#FeedbackR').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show"></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -118,22 +111,18 @@
|
||||||
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
||||||
<table class="tbl mb-2" >
|
<table class="tbl mb-2" >
|
||||||
<tr><!--Header Start-->
|
<tr><!--Header Start-->
|
||||||
<th>Side</th>
|
<th>Admin-side</th>
|
||||||
<th>Beskrivelse</th>
|
<th>Beskrivelse kan fjernes?</th>
|
||||||
<th>Create</th>
|
<th>Opret</th>
|
||||||
<th>Read</th>
|
<th>Se</th>
|
||||||
<th>Update</th>
|
<th>Rediger</th>
|
||||||
<th>Delete</th>
|
<th>Slet</th>
|
||||||
<th>Fuld Kontrol</th>
|
<th>Fuld Kontrol</th>
|
||||||
</tr><!--Header Slut-->
|
</tr><!--Header Slut-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>Admin Panel</td>
|
<td>Admin Panel</td>
|
||||||
<td><p>Adgang til admin panelet</p></td>
|
<td><p>Adgang til admin panelet</p></td>
|
||||||
<td></td>
|
<td colspan="5"><input type="checkbox" name="value[]" value="admin.panel.show"></td>
|
||||||
<td><input type="checkbox" name="value[]" value="admin.panel.show"></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr><!--Bruger Start-->
|
<tr><!--Bruger Start-->
|
||||||
<td>Brugere</td>
|
<td>Brugere</td>
|
||||||
|
@ -201,9 +190,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>Reservationer</td>
|
<td>Reservationer</td>
|
||||||
<td>Empty</td>
|
<td>Empty</td>
|
||||||
<td><input id="ReservationC" onclick="if ($('#ReservationCAccount').prop('checked') == false) $('#ReservationCAccount').prop('checked', true); else $('#ReservationCAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
<td></td>
|
||||||
<td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
<td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||||
<td><input id="ReservationU" type="checkbox" name="value[]" value="washing.machine.reservation.edit"></td>
|
<td></td>
|
||||||
<td><input id="ReservationD" onclick="if ($('#ReservationCAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
<td><input id="ReservationD" onclick="if ($('#ReservationCAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||||
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td>
|
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -228,9 +217,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>Feedback</td>
|
<td>Feedback</td>
|
||||||
<td><p>Empty</p></td>
|
<td><p>Empty</p></td>
|
||||||
<td><input id="FeedbackC" onclick="if ($('#FeedbackCAccount').prop('checked') == false) $('#FeedbackCAccount').prop('checked', true); else $('#FeedbackCAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.create"></td>
|
<td></td>
|
||||||
<td><input id="FeedbackR" onclick="if ($('#FeedbackRAccount').prop('checked') == false) $('#FeedbackRAccount').prop('checked', true); else $('#FeedbackRAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show"></td>
|
<td><input id="FeedbackR" onclick="if ($('#FeedbackRAccount').prop('checked') == false) $('#FeedbackRAccount').prop('checked', true); else $('#FeedbackRAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show"></td>
|
||||||
<td><input id="FeedbackU" type="checkbox" name="value[]" value="feedback.edit"></td>
|
<td></td>
|
||||||
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete"></td>
|
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete"></td>
|
||||||
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td>
|
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -309,12 +298,12 @@
|
||||||
//Show konto settings
|
//Show konto settings
|
||||||
$("#kontoButton").click(function(){
|
$("#kontoButton").click(function(){
|
||||||
var value = $('#kontoButton').text();
|
var value = $('#kontoButton').text();
|
||||||
if(value === 'Konto rettigheder'){
|
if(value === 'App rettigheder'){
|
||||||
$('#konto').slideDown('slow');
|
$('#konto').slideDown('slow');
|
||||||
$('#kontoButton').html('Luk konto rettigheder')
|
$('#kontoButton').html('Luk app rettigheder')
|
||||||
}else{
|
}else{
|
||||||
$('#konto').slideUp('slow');
|
$('#konto').slideUp('slow');
|
||||||
$('#kontoButton').html('Konto rettigheder')
|
$('#kontoButton').html('App rettigheder')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-2" style="width: 100%;">
|
<div class="mb-2" style="width: 100%;">
|
||||||
<button id="kontoButton" type="button" class="btn btn-sde-blue mb-1 mr-1" value="konto">Rediger konto rettigheder</button>
|
<button id="kontoButton" type="button" class="btn btn-sde-blue mb-1 mr-1" value="konto">Rediger app rettigheder</button>
|
||||||
<button id="adminButton" type="button" class="btn btn-sde-blue mb-1">Rediger admin rettigheder</button>
|
<button id="adminButton" type="button" class="btn btn-sde-blue mb-1">Rediger admin rettigheder</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -47,18 +47,11 @@
|
||||||
<small class="form-text text-muted">Her kan alle basale rettigheder for appens forbrugere slås til eller fra.</small>
|
<small class="form-text text-muted">Her kan alle basale rettigheder for appens forbrugere slås til eller fra.</small>
|
||||||
<table class="tbl mb-2">
|
<table class="tbl mb-2">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Konto</th>
|
<th>App-side</th>
|
||||||
<th>Beskrivelse</th>
|
<th>Beskrivelse kan fjernes?</th>
|
||||||
<th>Create</th>
|
<th>Opret/Tilmeld</th>
|
||||||
<th>Read</th>
|
<th>Se</th>
|
||||||
<th>Delete</th>
|
<th>Slet/Afmeld</th>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Konto</td>
|
|
||||||
<td><p>Egen bruger</p></td>
|
|
||||||
<td></td>
|
|
||||||
<td><input type="checkbox" name="value[]" value="ownuser.edit" @if ($role->hasPermissionTo("ownuser.edit")) checked @endif></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Nyheder</td>
|
<td>Nyheder</td>
|
||||||
|
@ -77,9 +70,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>Aktiviteter</td>
|
<td>Aktiviteter</td>
|
||||||
<td><p>Empty</p></td>
|
<td><p>Empty</p></td>
|
||||||
<td></td>
|
<td>//TEST<input id="EventRAccount" type="checkbox" name="value[]" value="userevent.create" @if ($role->hasPermissionTo("userevent.create")) checked @endif></td>
|
||||||
<td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show" @if ($role->hasPermissionTo("event.show")) checked @endif></td>
|
<td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show" @if ($role->hasPermissionTo("event.show")) checked @endif></td>
|
||||||
<td></td>
|
<td>//TEST<input id="EventRAccount" type="checkbox" name="value[]" value="userevent.delete" @if ($role->hasPermissionTo("userevent.delete")) checked @endif></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Reservationer</td>
|
<td>Reservationer</td>
|
||||||
|
@ -106,7 +99,7 @@
|
||||||
<td>Feedback</td>
|
<td>Feedback</td>
|
||||||
<td>Empty</td>
|
<td>Empty</td>
|
||||||
<td><input id="FeedbackCAccount" onclick="if ($('#FeedbackC').prop('checked') == false) $('#FeedbackC').prop('checked', true); else $('#FeedbackC').prop('checked', false);" type="checkbox" name="value[]" value="feedback.create" @if ($role->hasPermissionTo("feedback.create")) checked @endif></td>
|
<td><input id="FeedbackCAccount" onclick="if ($('#FeedbackC').prop('checked') == false) $('#FeedbackC').prop('checked', true); else $('#FeedbackC').prop('checked', false);" type="checkbox" name="value[]" value="feedback.create" @if ($role->hasPermissionTo("feedback.create")) checked @endif></td>
|
||||||
<td><input id="FeedbackRAccount" onclick="if ($('#FeedbackR').prop('checked') == false) $('#FeedbackR').prop('checked', true); else $('#FeedbackR').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show" @if ($role->hasPermissionTo("feedback.show")) checked @endif></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -117,25 +110,21 @@
|
||||||
<div id="admin">
|
<div id="admin">
|
||||||
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
||||||
<table class="tbl mb-2" >
|
<table class="tbl mb-2" >
|
||||||
<tr><!--Header Start-->
|
<tr>
|
||||||
<th>Admin</th>
|
<th>Admin-side</th>
|
||||||
<th>Beskrivelse</th>
|
<th>Beskrivelse kan fjernes?</th>
|
||||||
<th>Create</th>
|
<th>Opret</th>
|
||||||
<th>Read</th>
|
<th>Se</th>
|
||||||
<th>Update</th>
|
<th>Rediger</th>
|
||||||
<th>Delete</th>
|
<th>Slet</th>
|
||||||
<th>Fuld Kontrol</th>
|
<th>Fuld Kontrol</th>
|
||||||
</tr><!--Header Slut-->
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Admin Panel</td>
|
<td>Admin Panel</td>
|
||||||
<td><p>Adgang til admin panelet</p></td>
|
<td><p>Adgang til admin panelet</p></td>
|
||||||
<td></td>
|
<td colspan="5"><input type="checkbox" name="value[]" value="admin.panel.show" @if ($role->hasPermissionTo("admin.panel.show")) checked @endif></td>
|
||||||
<td><input type="checkbox" name="value[]" value="admin.panel.show" @if ($role->hasPermissionTo("admin.panel.show")) checked @endif></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr><!--Bruger Start-->
|
<tr>
|
||||||
<td>Brugere</td>
|
<td>Brugere</td>
|
||||||
<td><p>Empty</p></td>
|
<td><p>Empty</p></td>
|
||||||
<td><input id="UserC" type="checkbox" name="value[]" value="user.create" @if ($role->hasPermissionTo("user.create")) checked @endif></td>
|
<td><input id="UserC" type="checkbox" name="value[]" value="user.create" @if ($role->hasPermissionTo("user.create")) checked @endif></td>
|
||||||
|
@ -143,7 +132,7 @@
|
||||||
<td><input id="UserU" type="checkbox" name="value[]" value="user.edit" @if ($role->hasPermissionTo("user.edit")) checked @endif></td>
|
<td><input id="UserU" type="checkbox" name="value[]" value="user.edit" @if ($role->hasPermissionTo("user.edit")) checked @endif></td>
|
||||||
<td><input id="UserD" type="checkbox" name="value[]" value="user.delete" @if ($role->hasPermissionTo("user.delete")) checked @endif></td>
|
<td><input id="UserD" type="checkbox" name="value[]" value="user.delete" @if ($role->hasPermissionTo("user.delete")) checked @endif></td>
|
||||||
<td><input id="User" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
<td><input id="User" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
</tr><!--Bruger Start-->
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Roller</td>
|
<td>Roller</td>
|
||||||
<td><p>Empty</p></td>
|
<td><p>Empty</p></td>
|
||||||
|
@ -201,9 +190,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>Reservationer</td>
|
<td>Reservationer</td>
|
||||||
<td>Empty</td>
|
<td>Empty</td>
|
||||||
<td><input id="ReservationC" onclick="if ($('#ReservationCAccount').prop('checked') == false) $('#ReservationCAccount').prop('checked', true); else $('#ReservationCAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.create" @if ($role->hasPermissionTo("washing.machine.reservation.create")) checked @endif></td>
|
<td></td>
|
||||||
<td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show" @if ($role->hasPermissionTo("washing.machine.reservation.show")) checked @endif></td>
|
<td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show" @if ($role->hasPermissionTo("washing.machine.reservation.show")) checked @endif></td>
|
||||||
<td><input id="ReservationU" type="checkbox" name="value[]" value="washing.machine.reservation.edit" @if ($role->hasPermissionTo("washing.machine.reservation.edit")) checked @endif></td>
|
<td></td>
|
||||||
<td><input id="ReservationD" onclick="if ($('#ReservationDAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete" @if ($role->hasPermissionTo("washing.machine.reservation.delete")) checked @endif></td>
|
<td><input id="ReservationD" onclick="if ($('#ReservationDAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete" @if ($role->hasPermissionTo("washing.machine.reservation.delete")) checked @endif></td>
|
||||||
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -228,9 +217,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>Feedback</td>
|
<td>Feedback</td>
|
||||||
<td><p>Empty</p></td>
|
<td><p>Empty</p></td>
|
||||||
<td><input id="FeedbackC" onclick="if ($('#FeedbackCAccount').prop('checked') == false) $('#FeedbackCAccount').prop('checked', true); else $('#FeedbackCAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.create" @if ($role->hasPermissionTo("feedback.create")) checked @endif></td>
|
<td></td>
|
||||||
<td><input id="FeedbackR" onclick="if ($('#FeedbackRAccount').prop('checked') == false) $('#FeedbackRAccount').prop('checked', true); else $('#FeedbackRAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show" @if ($role->hasPermissionTo("feedback.show")) checked @endif></td>
|
<td><input id="FeedbackR" onclick="if ($('#FeedbackRAccount').prop('checked') == false) $('#FeedbackRAccount').prop('checked', true); else $('#FeedbackRAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show" @if ($role->hasPermissionTo("feedback.show")) checked @endif></td>
|
||||||
<td><input id="FeedbackU" type="checkbox" name="value[]" value="feedback.edit" @if ($role->hasPermissionTo("feedback.edit")) checked @endif></td>
|
<td></td>
|
||||||
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete" @if ($role->hasPermissionTo("feedback.delete")) checked @endif></td>
|
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete" @if ($role->hasPermissionTo("feedback.delete")) checked @endif></td>
|
||||||
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -311,12 +300,12 @@
|
||||||
//Show konto settings
|
//Show konto settings
|
||||||
$("#kontoButton").click(function(){
|
$("#kontoButton").click(function(){
|
||||||
var value = $('#kontoButton').text();
|
var value = $('#kontoButton').text();
|
||||||
if(value === 'Rediger konto rettigheder'){
|
if(value === 'Rediger app rettigheder'){
|
||||||
$('#konto').slideDown('slow');
|
$('#konto').slideDown('slow');
|
||||||
$('#kontoButton').html('Luk konto rettigheder')
|
$('#kontoButton').html('Luk app rettigheder')
|
||||||
}else{
|
}else{
|
||||||
$('#konto').slideUp('slow');
|
$('#konto').slideUp('slow');
|
||||||
$('#kontoButton').html('Rediger konto rettigheder')
|
$('#kontoButton').html('Rediger app rettigheder')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -333,7 +322,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function FullControl(FC) { //FC == Full Controll
|
function FullControl(FC) { //FC == Full Control checkbox element
|
||||||
var Create = $(FC).attr('id') + 'C'; // Takes FC's ID Name and puts C at the back of it
|
var Create = $(FC).attr('id') + 'C'; // Takes FC's ID Name and puts C at the back of it
|
||||||
var Read = $(FC).attr('id') + 'R'; // Takes FC's ID Name and puts R at the back of it
|
var Read = $(FC).attr('id') + 'R'; // Takes FC's ID Name and puts R at the back of it
|
||||||
var Update = $(FC).attr('id') + 'U'; // Takes FC's ID Name and puts U at the back of it
|
var Update = $(FC).attr('id') + 'U'; // Takes FC's ID Name and puts U at the back of it
|
||||||
|
@ -358,6 +347,9 @@
|
||||||
for (i = 0; i < arr.length; i++) {
|
for (i = 0; i < arr.length; i++) {
|
||||||
if ($('#'+arr[i]+'C').prop('checked') == true && $('#'+arr[i]+'R').prop('checked') == true && $('#'+arr[i]+'U').prop('checked') == true && $('#'+arr[i]+'D').prop('checked') == true)
|
if ($('#'+arr[i]+'C').prop('checked') == true && $('#'+arr[i]+'R').prop('checked') == true && $('#'+arr[i]+'U').prop('checked') == true && $('#'+arr[i]+'D').prop('checked') == true)
|
||||||
$('#'+arr[i]).prop('checked', true);
|
$('#'+arr[i]).prop('checked', true);
|
||||||
|
else if(arr[i] == 'Feedback' || arr[i] == 'Reservation')
|
||||||
|
if($('#'+arr[i]+'R').prop('checked') == true && $('#'+arr[i]+'D').prop('checked') == true)
|
||||||
|
$('#'+arr[i]).prop('checked', true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -45,16 +45,26 @@
|
||||||
|
|
||||||
.img{
|
.img{
|
||||||
width: 1em;
|
width: 1em;
|
||||||
|
height: calc(1em + 20px);
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
padding: 3px 10px;
|
padding: 0 10px;
|
||||||
border-color: cadetblue;
|
border-color: #00788a;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
background-color: cadetblue;
|
background-color: #00788a;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
float: left;
|
float: left;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img > a {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.information{
|
.information{
|
||||||
|
|
Loading…
Reference in New Issue