v0.10.15o - Permissions semi works
This commit is contained in:
parent
b6d819e5f8
commit
3235cea505
.idea/codeStyles
skolehjem
|
@ -94,7 +94,6 @@
|
|||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
|
@ -59,7 +59,7 @@ class rolesController extends Controller
|
|||
]);
|
||||
|
||||
$brugerPermissions = new Collection();
|
||||
if (!$request->value === null) {
|
||||
if ($request->value !== null) {
|
||||
foreach ($request->value as $valuee) {
|
||||
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", $valuee)->first());
|
||||
}
|
||||
|
|
|
@ -301,8 +301,7 @@
|
|||
});
|
||||
})
|
||||
|
||||
//User hide permissions
|
||||
|
||||
// hide permissions
|
||||
$('#konto').hide();
|
||||
$('#admin').hide();
|
||||
|
||||
|
|
|
@ -10,6 +10,23 @@
|
|||
@endsection
|
||||
|
||||
@section("content")
|
||||
<style>
|
||||
td > p, td > input {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.form-text {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.text-muted {
|
||||
color: #6c757d !important;
|
||||
}
|
||||
</style>
|
||||
<h1>Rediger Rolle:</h1>
|
||||
<form method="post" action="{{ route("roles.update", ['role' => $role]) }}">
|
||||
@csrf
|
||||
|
@ -19,6 +36,209 @@
|
|||
<input type="text" name="name" id="name" placeholder="Admin" value="{{ $role->name }}" required>
|
||||
<label for="name">Beskrivelse:</label>
|
||||
<input type="text" name="description" id="description" placeholder="Admin rollen bruges til administratorene" value="{{ $role->description }}" required>
|
||||
|
||||
|
||||
<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="adminButton" type="button" class="btn btn-sde-blue mb-1">Rediger admin rettigheder</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="konto">
|
||||
<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">
|
||||
<tr>
|
||||
<th>Konto</th>
|
||||
<th>Beskrivelse</th>
|
||||
<th>Create</th>
|
||||
<th>Read</th>
|
||||
<th>Delete</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>
|
||||
<td>Nyheder</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" name="value[]" value="news.show"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Menuplan</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" name="value[]" value="menuplan.show"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aktiviteter</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" name="value[]" value="event.show"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reservationer</td>
|
||||
<td>Empty</td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kontakter</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" name="value[]" value="contact.show"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vejledning</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" name="value[]" value="guides.show"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Feedback</td>
|
||||
<td>Empty</td>
|
||||
<td><input type="checkbox" name="value[]" value="feedback.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="feedback.show"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="admin">
|
||||
<small class="form-text text-muted">Her kan alle rettigheder for administrationssiden slås til eller fra.</small>
|
||||
<table class="tbl mb-2" >
|
||||
<tr><!--Header Start-->
|
||||
<th>Side</th>
|
||||
<th>Beskrivelse</th>
|
||||
<th>Create</th>
|
||||
<th>Read</th>
|
||||
<th>Update</th>
|
||||
<th>Delete</th>
|
||||
<th>Fuld Kontrol</th>
|
||||
</tr><!--Header Slut-->
|
||||
<tr>
|
||||
<td>Admin Panel</td>
|
||||
<td><p>Adgang til admin panelet</p></td>
|
||||
<td></td>
|
||||
<td><input type="checkbox" name="value[]" value="admin.panel.show"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr><!--Bruger Start-->
|
||||
<td>Brugere</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="user.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="user.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="user.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="user.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr><!--Bruger Start-->
|
||||
<tr>
|
||||
<td>Roller</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="roles.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="roles.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="roles.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="roles.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nyheder</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Menuplan</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="news.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="news.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="news.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="news.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aktiviteter</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="events.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="events.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="events.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="events.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lokation</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="locations.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="locations.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="locations.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="locations.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vaskemaskiner</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reservationer</td>
|
||||
<td>Empty</td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kontakter</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="contact.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="contact.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="contact.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="contact.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vejledning</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="guides.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="guides.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="guides.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="guides.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Feedback</td>
|
||||
<td><p>Empty</p></td>
|
||||
<td><input type="checkbox" name="value[]" value="feedback.create"></td>
|
||||
<td><input type="checkbox" name="value[]" value="feedback.show"></td>
|
||||
<td><input type="checkbox" name="value[]" value="feedback.edit"></td>
|
||||
<td><input type="checkbox" name="value[]" value="feedback.delete"></td>
|
||||
<td><input type="checkbox" name="value[]" value="Bike"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit-->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="submit" id="disable" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
@endsection
|
||||
|
@ -82,5 +302,39 @@
|
|||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
// hide permissions
|
||||
$('#konto').hide();
|
||||
$('#admin').hide();
|
||||
|
||||
|
||||
//Show konto settings
|
||||
$("#kontoButton").click(function(){
|
||||
var value = $('#kontoButton').text();
|
||||
if(value === 'Rediger konto rettigheder'){
|
||||
$('#konto').slideDown('slow');
|
||||
$('#kontoButton').html('Luk konto rettigheder')
|
||||
}else{
|
||||
$('#konto').slideUp('slow');
|
||||
$('#kontoButton').html('Rediger konto rettigheder')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Show admin permissions
|
||||
$("#adminButton").click(function(){
|
||||
var value = $('#adminButton').text();
|
||||
if(value === 'Rediger admin rettigheder'){
|
||||
$('#admin').slideDown('slow');
|
||||
$('#adminButton').html('Luk admin rettigheder')
|
||||
}else{
|
||||
$('#admin').slideUp('slow');
|
||||
$('#adminButton').html('Rediger admin rettigheder')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
|
Loading…
Reference in New Issue