v0.10.16 - Various fixes

This commit is contained in:
frederikpyt 2020-08-31 09:36:10 +02:00
parent d8a754d398
commit c6c54996b5
19 changed files with 55 additions and 68 deletions

View File

@ -15,8 +15,7 @@ class ContactController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:contact.list" ])->only("index"); $this->middleware([ "check.auth:contact.show" ])->only("show", "index");
$this->middleware([ "check.auth:contact.show" ])->only("show");
$this->middleware([ "check.auth:contact.create" ])->only("create", "store"); $this->middleware([ "check.auth:contact.create" ])->only("create", "store");
$this->middleware([ "check.auth:contact.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:contact.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:contact.delete" ])->only("delete"); $this->middleware([ "check.auth:contact.delete" ])->only("delete");

View File

@ -19,8 +19,7 @@ class EventController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:event.list" ])->only("index"); $this->middleware([ "check.auth:event.show" ])->only("show", "index");
$this->middleware([ "check.auth:event.show" ])->only("show");
$this->middleware([ "check.auth:event.create" ])->only("create", "store"); $this->middleware([ "check.auth:event.create" ])->only("create", "store");
$this->middleware([ "check.auth:event.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:event.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:event.delete" ])->only("delete"); $this->middleware([ "check.auth:event.delete" ])->only("delete");

View File

@ -15,8 +15,7 @@ class FeedbackController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:feedback.list" ])->only("index"); $this->middleware([ "check.auth:feedback.show" ])->only("show", "index");
$this->middleware([ "check.auth:feedback.show" ])->only("show");
$this->middleware([ "check.auth:feedback.create" ])->only("create", "store"); $this->middleware([ "check.auth:feedback.create" ])->only("create", "store");
$this->middleware([ "check.auth:feedback.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:feedback.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:feedback.delete" ])->only("delete"); $this->middleware([ "check.auth:feedback.delete" ])->only("delete");

View File

@ -15,8 +15,7 @@ class GuideController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:guides.list" ])->only("index"); $this->middleware([ "check.auth:guides.show" ])->only("show", "index");
$this->middleware([ "check.auth:guides.show" ])->only("show");
$this->middleware([ "check.auth:guides.create" ])->only("create", "store"); $this->middleware([ "check.auth:guides.create" ])->only("create", "store");
$this->middleware([ "check.auth:guides.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:guides.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:guides.delete" ])->only("delete"); $this->middleware([ "check.auth:guides.delete" ])->only("delete");

View File

@ -17,8 +17,7 @@ class LocationController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:locations.list" ])->only("index"); $this->middleware([ "check.auth:locations.show" ])->only("show", "index");
$this->middleware([ "check.auth:locations.show" ])->only("show");
$this->middleware([ "check.auth:locations.create" ])->only("create", "store"); $this->middleware([ "check.auth:locations.create" ])->only("create", "store");
$this->middleware([ "check.auth:locations.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:locations.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:locations.delete" ])->only("delete"); $this->middleware([ "check.auth:locations.delete" ])->only("delete");

View File

@ -23,8 +23,7 @@ class MenuPlanController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:menuplan.list" ])->only("index"); $this->middleware([ "check.auth:menuplan.show" ])->only("show", "index");
$this->middleware([ "check.auth:menuplan.show" ])->only("show");
$this->middleware([ "check.auth:menuplan.create" ])->only("create", "store"); $this->middleware([ "check.auth:menuplan.create" ])->only("create", "store");
$this->middleware([ "check.auth:menuplan.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:menuplan.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:menuplan.delete" ])->only("delete"); $this->middleware([ "check.auth:menuplan.delete" ])->only("delete");

View File

@ -17,8 +17,7 @@ class NewsController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:news.list" ])->only("index"); $this->middleware([ "check.auth:news.show" ])->only("show", "index");
$this->middleware([ "check.auth:news.show" ])->only("show");
$this->middleware([ "check.auth:news.create" ])->only("create", "store"); $this->middleware([ "check.auth:news.create" ])->only("create", "store");
$this->middleware([ "check.auth:news.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:news.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:news.delete" ])->only("delete"); $this->middleware([ "check.auth:news.delete" ])->only("delete");

View File

@ -13,8 +13,7 @@ class ResourceCategoryController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:resource.category.list" ])->only("index"); $this->middleware([ "check.auth:resource.category.show" ])->only("show", "index");
$this->middleware([ "check.auth:resource.category.show" ])->only("show");
$this->middleware([ "check.auth:resource.category.create" ])->only("create", "store"); $this->middleware([ "check.auth:resource.category.create" ])->only("create", "store");
$this->middleware([ "check.auth:resource.category.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:resource.category.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:resource.category.delete" ])->only("delete"); $this->middleware([ "check.auth:resource.category.delete" ])->only("delete");

View File

@ -16,8 +16,7 @@ class ResourceController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:resource.list" ])->only("index"); $this->middleware([ "check.auth:resource.show" ])->only("show", "index");
$this->middleware([ "check.auth:resource.show" ])->only("show");
$this->middleware([ "check.auth:resource.create" ])->only("create", "store"); $this->middleware([ "check.auth:resource.create" ])->only("create", "store");
$this->middleware([ "check.auth:resource.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:resource.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:resource.delete" ])->only("delete"); $this->middleware([ "check.auth:resource.delete" ])->only("delete");

View File

@ -13,8 +13,7 @@ class ResourceExtensionController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:resource.extension.list" ])->only("index"); $this->middleware([ "check.auth:resource.extension.show" ])->only("show", "index");
$this->middleware([ "check.auth:resource.extension.show" ])->only("show");
$this->middleware([ "check.auth:resource.extension.create" ])->only("create", "store"); $this->middleware([ "check.auth:resource.extension.create" ])->only("create", "store");
$this->middleware([ "check.auth:resource.extension.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:resource.extension.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:resource.extension.delete" ])->only("delete"); $this->middleware([ "check.auth:resource.extension.delete" ])->only("delete");

View File

@ -8,15 +8,14 @@ use Illuminate\Support\Facades\DB;
use Spatie\Permission\Models\Role; use Spatie\Permission\Models\Role;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
class rolesController extends Controller class RolesController extends Controller
{ {
public function __construct() public function __construct()
{ {
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:roles.list" ])->only("index"); $this->middleware([ "check.auth:roles.show" ])->only("show", "index");
$this->middleware([ "check.auth:roles.show" ])->only("show");
$this->middleware([ "check.auth:roles.create" ])->only("create", "store"); $this->middleware([ "check.auth:roles.create" ])->only("create", "store");
$this->middleware([ "check.auth:roles.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:roles.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:roles.delete" ])->only("delete"); $this->middleware([ "check.auth:roles.delete" ])->only("delete");

View File

@ -23,11 +23,11 @@ class UserController extends Controller
public function __construct() public function __construct()
{ {
$this->middleware([ "auth" ])->only("logout"); $this->middleware([ "auth" ])->only("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"]);
$this->middleware([ "check.auth:user.list" ])->only("index"); $this->middleware([ "check.auth:user.show" ])->only("show", "index");
$this->middleware([ "check.auth:user.show" ])->only("show");
$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");

View File

@ -20,8 +20,7 @@ class WashingMachineController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:washing.machine.list" ])->only("index"); $this->middleware([ "check.auth:washing.machine.show" ])->only("show", "index");
$this->middleware([ "check.auth:washing.machine.show" ])->only("show");
$this->middleware([ "check.auth:washing.machine.create" ])->only("create", "store"); $this->middleware([ "check.auth:washing.machine.create" ])->only("create", "store");
$this->middleware([ "check.auth:washing.machine.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:washing.machine.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:washing.machine.delete" ])->only("delete"); $this->middleware([ "check.auth:washing.machine.delete" ])->only("delete");

View File

@ -24,8 +24,7 @@ class WashingReservationController extends Controller
$this->middleware([ "auth" ]); $this->middleware([ "auth" ]);
$this->middleware([ "lang" ]); $this->middleware([ "lang" ]);
$this->middleware([ "check.auth:washing.machine.reservation.list" ])->only(["index", "appindex"]); $this->middleware([ "check.auth:washing.machine.reservation.show" ])->only("show", "index", "appindex");
$this->middleware([ "check.auth:washing.machine.reservation.show" ])->only("show");
$this->middleware([ "check.auth:washing.machine.reservation.create" ])->only("create", "store"); $this->middleware([ "check.auth:washing.machine.reservation.create" ])->only("create", "store");
$this->middleware([ "check.auth:washing.machine.reservation.edit" ])->only("edit", "update"); $this->middleware([ "check.auth:washing.machine.reservation.edit" ])->only("edit", "update");
$this->middleware([ "check.auth:washing.machine.reservation.delete" ])->only("delete"); $this->middleware([ "check.auth:washing.machine.reservation.delete" ])->only("delete");

View File

@ -18,35 +18,15 @@ class PermissionSeeder extends Seeder
* The USER specific permissions * The USER specific permissions
*/ */
"user.create" => "Creation of new user", "user.create" => "Creation of new user",
"user.list" => "Access to list the users.",
"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", "ownuser.edit" => "Allows editing of your own user",
/**
* The CALENDAR specific permissions //TODO: Do we use them?
*/
"calendar.create" => "Create a new event.",
"calendar.list" => "Shows all events.",
"calendar.show" => "Shows a specific event.",
"calendar.edit" => "Allows editing of events.",
"calendar.delete" => "Allows the deletion of events.",
/**
* The EXTERNAL LINK specific permissions
*/
"link.external.create" => "Create a new external link.",
"link.external.list" => "List all external links.",
"link.external.show" => "Show a specific external link",
"link.external.edit" => "Allows editing of external links.",
"link.external.delete" => "Allows deletion of external links",
/** /**
* The EVENT specific permissions * The EVENT specific permissions
*/ */
"event.create" => "Create a new event", "event.create" => "Create a new event",
"event.list" => "Shows all events",
"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",
@ -55,7 +35,6 @@ class PermissionSeeder extends Seeder
* The CONTACT specific permissions * The CONTACT specific permissions
*/ */
"contact.create" => "Creates a new contact", "contact.create" => "Creates a new contact",
"contact.list" => "Shows all contacts",
"contact.show" => "Shows a specific contact", "contact.show" => "Shows a specific contact",
"contact.edit" => "allows editing of contacts", "contact.edit" => "allows editing of contacts",
"contact.delete" => "Allows deletion of contacts", "contact.delete" => "Allows deletion of contacts",
@ -64,7 +43,6 @@ class PermissionSeeder extends Seeder
* The FEEDBACK specific permissions * The FEEDBACK specific permissions
*/ */
"feedback.create" => "Creates a new feedback message", "feedback.create" => "Creates a new feedback message",
"feedback.list" => "Shows all feedback messages",
"feedback.show" => "Shows a specific feedback message", "feedback.show" => "Shows a specific feedback message",
"feedback.edit" => "allows editing of feedback messages", "feedback.edit" => "allows editing of feedback messages",
"feedback.delete" => "allows deletion of feedback messages", "feedback.delete" => "allows deletion of feedback messages",
@ -73,7 +51,6 @@ class PermissionSeeder extends Seeder
* The MENUPLAN specific permissions * The MENUPLAN specific permissions
*/ */
"menuplan.create" => "Create a new menuplan", "menuplan.create" => "Create a new menuplan",
"menuplan.list" => "Shows all menuplans",
"menuplan.show" => "Shows a specific menuplan", "menuplan.show" => "Shows a specific menuplan",
"menuplan.edit" => "Allows editing of menuplans", "menuplan.edit" => "Allows editing of menuplans",
"menuplan.delete" => "Allows deletion of menuplans", "menuplan.delete" => "Allows deletion of menuplans",
@ -82,7 +59,6 @@ class PermissionSeeder extends Seeder
* The RESOURCE CATEGORY specific permissions * The RESOURCE CATEGORY specific permissions
*/ */
"resource.category.create" => "Create a new resource category", "resource.category.create" => "Create a new resource category",
"resource.category.list" => "Shows all resource categories",
"resource.category.show" => "Shows a specific resource category", "resource.category.show" => "Shows a specific resource category",
"resource.category.edit" => "Allows editing of resource categories", "resource.category.edit" => "Allows editing of resource categories",
"resource.category.delete" => "Allows deletion of resource categories", "resource.category.delete" => "Allows deletion of resource categories",
@ -91,7 +67,6 @@ class PermissionSeeder extends Seeder
* The RESOURCE EXTENSION specific permissions * The RESOURCE EXTENSION specific permissions
*/ */
"resource.extension.create" => "Create a new resource extension", "resource.extension.create" => "Create a new resource extension",
"resource.extension.list" => "Shows all resource extensions",
"resource.extension.show" => "Shows a specific resource extension", "resource.extension.show" => "Shows a specific resource extension",
"resource.extension.edit" => "Allows editing of resource extensions", "resource.extension.edit" => "Allows editing of resource extensions",
"resource.extension.delete" => "Allows deletion of resource extensions", "resource.extension.delete" => "Allows deletion of resource extensions",
@ -100,7 +75,6 @@ class PermissionSeeder extends Seeder
* The RESOURCE specific permissions * The RESOURCE specific permissions
*/ */
"resource.create" => "Create a new resource", "resource.create" => "Create a new resource",
"resource.list" => "Shows all resources",
"resource.show" => "Shows a specific resource", "resource.show" => "Shows a specific resource",
"resource.edit" => "Allows editing of resources", "resource.edit" => "Allows editing of resources",
"resource.delete" => "Allows deletion of resources", "resource.delete" => "Allows deletion of resources",
@ -109,7 +83,6 @@ class PermissionSeeder extends Seeder
* The WASHING MACHINE specific permissions * The WASHING MACHINE specific permissions
*/ */
"washing.machine.create" => "Create a new washing machine", "washing.machine.create" => "Create a new washing machine",
"washing.machine.list" => "Shows all washing machines",
"washing.machine.show" => "Shows a specific washing machine", "washing.machine.show" => "Shows a specific washing machine",
"washing.machine.edit" => "Allows editing of washing machines", "washing.machine.edit" => "Allows editing of washing machines",
"washing.machine.delete" => "Allows deletion of washing machines", "washing.machine.delete" => "Allows deletion of washing machines",
@ -118,7 +91,6 @@ class PermissionSeeder extends Seeder
* The WASHING MACHINE RESERVATION specific permissions * The WASHING MACHINE RESERVATION specific permissions
*/ */
"washing.machine.reservation.create" => "Create a new washing machine reservation", "washing.machine.reservation.create" => "Create a new washing machine reservation",
"washing.machine.reservation.list" => "Shows all washing machine reservations",
"washing.machine.reservation.show" => "Shows a specific washing machine reservation", "washing.machine.reservation.show" => "Shows a specific washing machine reservation",
"washing.machine.reservation.edit" => "Allows editing of washing machine reservations", "washing.machine.reservation.edit" => "Allows editing of washing machine reservations",
"washing.machine.reservation.delete" => "Allows deletion of washing machine reservations", "washing.machine.reservation.delete" => "Allows deletion of washing machine reservations",
@ -127,7 +99,6 @@ class PermissionSeeder extends Seeder
* The ROLES specific permissions * The ROLES specific permissions
*/ */
"roles.create" => "Create a new role", "roles.create" => "Create a new role",
"roles.list" => "Shows all roles",
"roles.show" => "Shows a specific role", "roles.show" => "Shows a specific role",
"roles.edit" => "Allows editing of roles", "roles.edit" => "Allows editing of roles",
"roles.delete" => "Allows deletion of roles", "roles.delete" => "Allows deletion of roles",
@ -136,7 +107,6 @@ class PermissionSeeder extends Seeder
* The GUIDE specific permissions * The GUIDE specific permissions
*/ */
"guides.create" => "Create a new guide", "guides.create" => "Create a new guide",
"guides.list" => "Shows all guides",
"guides.show" => "Shows a specific guide", "guides.show" => "Shows a specific guide",
"guides.edit" => "Allows editing of guides", "guides.edit" => "Allows editing of guides",
"guides.delete" => "Allows deletion of guides", "guides.delete" => "Allows deletion of guides",
@ -145,7 +115,6 @@ class PermissionSeeder extends Seeder
* The LOCATION specific permissions * The LOCATION specific permissions
*/ */
"locations.create" => "Create a new location", "locations.create" => "Create a new location",
"locations.list" => "Shows all locations",
"locations.show" => "Shows a specific location", "locations.show" => "Shows a specific location",
"locations.edit" => "Allows editing of locations", "locations.edit" => "Allows editing of locations",
"locations.delete" => "Allows deletion of locations", "locations.delete" => "Allows deletion of locations",
@ -154,7 +123,6 @@ class PermissionSeeder extends Seeder
* The NEWS specific permissions * The NEWS specific permissions
*/ */
"news.create" => "Create a new location", "news.create" => "Create a new location",
"news.list" => "Shows all locations",
"news.show" => "Shows a specific location", "news.show" => "Shows a specific location",
"news.edit" => "Allows editing of locations", "news.edit" => "Allows editing of locations",
"news.delete" => "Allows deletion of locations", "news.delete" => "Allows deletion of locations",

View File

@ -40,19 +40,15 @@ class RoleSeeder extends Seeder
//Bruger Permissions //Bruger Permissions
$brugerPermissions = new Collection(); $brugerPermissions = new Collection();
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "link.external.list")->first()); $brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "contact.show")->first());
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "contact.list")->first());
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "feedback.create")->first()); $brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "feedback.create")->first());
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "menuplan.list")->first()); $brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "menuplan.show")->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.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.list")->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", "=", "ownuser.edit")->first());
$brugerPermissions->add(\Spatie\Permission\Models\Permission::query()->where("name", "=", "event.list")->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", "=", "guides.list")->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.list")->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());
//Give permissions to Bruger (id: 2) //Give permissions to Bruger (id: 2)

View File

@ -4,6 +4,7 @@ function toggleMenu(menu) {
let htmlElement = document.getElementsByTagName('html')[0]; let htmlElement = document.getElementsByTagName('html')[0];
let mainElement = document.getElementsByTagName('main')[0]; let mainElement = document.getElementsByTagName('main')[0];
let iconElement = document.getElementById("icon"); let iconElement = document.getElementById("icon");
let headerElement = document.getElementById("header");
if(menuElement.classList.contains("hide")) { if(menuElement.classList.contains("hide")) {
menuElement.classList.remove("hide"); menuElement.classList.remove("hide");
@ -12,6 +13,7 @@ function toggleMenu(menu) {
logoElement.src = '/images/logos/Logo-hvid.svg'; logoElement.src = '/images/logos/Logo-hvid.svg';
iconElement.classList.remove("fa-times"); iconElement.classList.remove("fa-times");
iconElement.classList.add("fa-bars"); iconElement.classList.add("fa-bars");
headerElement.style.position = 'fixed';
} else { } else {
menuElement.classList.add("hide"); menuElement.classList.add("hide");
mainElement.classList.add("d-none"); mainElement.classList.add("d-none");
@ -19,6 +21,8 @@ function toggleMenu(menu) {
logoElement.src = '/images/logos/Logo-hvid.svg'; logoElement.src = '/images/logos/Logo-hvid.svg';
iconElement.classList.remove("fa-bars"); iconElement.classList.remove("fa-bars");
iconElement.classList.add("fa-times"); iconElement.classList.add("fa-times");
headerElement.style.position = 'relative';
headerElement.style.top = '0';
} }
} }

View File

@ -125,39 +125,61 @@
</div> </div>
</div> </div>
@if(auth()->user()->can('user.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "users.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "users.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('users.index') }}" class="text-white"><img src="{{asset("/images/icons/users-hvid.svg")}}" class="fa"><span style="margin-left: 4px;">Brugere</span></a></h3><span class="tooltiptext">Brugere</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('users.index') }}" class="text-white"><img src="{{asset("/images/icons/users-hvid.svg")}}" class="fa"><span style="margin-left: 4px;">Brugere</span></a></h3><span class="tooltiptext">Brugere</span></div>
</div> </div>
@endif
@if(auth()->user()->can('roles.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "roles.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "roles.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('roles.index') }}" class="text-white"><img src="{{asset("/images/icons/role.svg")}}" class="fa"><span style="margin-left: 4px;">Roller</span></a></h3><span class="tooltiptext">Roller</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('roles.index') }}" class="text-white"><img src="{{asset("/images/icons/role.svg")}}" class="fa"><span style="margin-left: 4px;">Roller</span></a></h3><span class="tooltiptext">Roller</span></div>
</div> </div>
@endif
@if(auth()->user()->can('news.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "news.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "news.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('news.index') }}" class="text-white"><img src="{{asset("/images/icons/news.svg")}}" class="fa"><span style="margin-left: 4px;">Nyheder</span></a></h3><span class="tooltiptext">Nyheder</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('news.index') }}" class="text-white"><img src="{{asset("/images/icons/news.svg")}}" class="fa"><span style="margin-left: 4px;">Nyheder</span></a></h3><span class="tooltiptext">Nyheder</span></div>
</div> </div>
@endif
@if(auth()->user()->can('menuplan.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "menu-plans.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "menu-plans.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('menu-plans.index') }}" class="text-white"><img src="{{asset("/images/icons/Menuplan.svg")}}" class="fa"><span style="margin-left: 4px;">Menuplan</span></a></h3><span class="tooltiptext">Menuplan</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('menu-plans.index') }}" class="text-white"><img src="{{asset("/images/icons/Menuplan.svg")}}" class="fa"><span style="margin-left: 4px;">Menuplan</span></a></h3><span class="tooltiptext">Menuplan</span></div>
</div> </div>
@endif
@if(auth()->user()->can('event.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "events.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "events.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('events.index') }}" class="text-white"><img src="{{asset("/images/icons/Aktiviteter.svg")}}" class="fa"><span style="margin-left: 4px;">Aktiviteter</span></a></h3><span class="tooltiptext">Aktiviteter</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('events.index') }}" class="text-white"><img src="{{asset("/images/icons/Aktiviteter.svg")}}" class="fa"><span style="margin-left: 4px;">Aktiviteter</span></a></h3><span class="tooltiptext">Aktiviteter</span></div>
</div> </div>
@endif
@if(auth()->user()->can('locations.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "locations.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "locations.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('locations.index') }}" class="text-white"><img src="{{asset("/images/icons/location.svg")}}" class="fa"><span style="margin-left: 4px;">Lokationer</span></a></h3><span class="tooltiptext">Lokationer</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('locations.index') }}" class="text-white"><img src="{{asset("/images/icons/location.svg")}}" class="fa"><span style="margin-left: 4px;">Lokationer</span></a></h3><span class="tooltiptext">Lokationer</span></div>
</div> </div>
@endif
@if(auth()->user()->can('washing.machine.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "washing-machines.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "washing-machines.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('washing-machines.index') }}" class="text-white"><img src="{{asset("/images/icons/wash.svg")}}" class="fa"><span style="margin-left: 4px;">Vaskemaskiner</span></a></h3><span class="tooltiptext">Vaskemaskiner</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('washing-machines.index') }}" class="text-white"><img src="{{asset("/images/icons/wash.svg")}}" class="fa"><span style="margin-left: 4px;">Vaskemaskiner</span></a></h3><span class="tooltiptext">Vaskemaskiner</span></div>
</div> </div>
@endif
@if(auth()->user()->can('washing.machine.reservation.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "washing-reservations.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "washing-reservations.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('washing-reservations.index') }}" class="text-white"><img src="{{asset("/images/icons/wash_res.svg")}}" class="fa"><span style="margin-left: 4px;">Reservationer</span></a></h3><span class="tooltiptext">Reservationer</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('washing-reservations.index') }}" class="text-white"><img src="{{asset("/images/icons/wash_res.svg")}}" class="fa"><span style="margin-left: 4px;">Reservationer</span></a></h3><span class="tooltiptext">Reservationer</span></div>
</div> </div>
@endif
@if(auth()->user()->can('contact.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "contacts.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "contacts.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('contacts.index') }}" class="text-white"><img src="{{asset("/images/icons/phone.svg")}}" class="fa"><span style="margin-left: 4px;">Kontakter</span></a></h3><span class="tooltiptext">Kontakter</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('contacts.index') }}" class="text-white"><img src="{{asset("/images/icons/phone.svg")}}" class="fa"><span style="margin-left: 4px;">Kontakter</span></a></h3><span class="tooltiptext">Kontakter</span></div>
</div> </div>
@endif
@if(auth()->user()->can('guides.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "guides.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "guides.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('guides.index') }}" class="text-white"><img src="{{asset("/images/icons/Vejledninger.svg")}}" class="fa"><span style="margin-left: 4px;">Vejledning</span></a></h3><span class="tooltiptext">Vejledning</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('guides.index') }}" class="text-white"><img src="{{asset("/images/icons/Vejledninger.svg")}}" class="fa"><span style="margin-left: 4px;">Vejledning</span></a></h3><span class="tooltiptext">Vejledning</span></div>
</div> </div>
@endif
@if(auth()->user()->can('feedback.show'))
<div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "feedbacks.index") active @endif"> <div class="segment @if(\Illuminate\Support\Facades\Request::route()->getName() == "feedbacks.index") active @endif">
<div class="tooltip"><h3 class="text-white"><a href="{{ route('feedbacks.index') }}" class="text-white"><img src="{{asset("/images/icons/feedback.svg")}}" class="fa"><span style="margin-left: 4px;">Feedback</span></a></h3><span class="tooltiptext">Feedback</span></div> <div class="tooltip"><h3 class="text-white"><a href="{{ route('feedbacks.index') }}" class="text-white"><img src="{{asset("/images/icons/feedback.svg")}}" class="fa"><span style="margin-left: 4px;">Feedback</span></a></h3><span class="tooltiptext">Feedback</span></div>
</div> </div>
@endif
</div> </div>
<div class="w-85" style="background-color: #cccccc;"> <div class="w-85" style="background-color: #cccccc;">
<div class="directorypath text-white"> <div class="directorypath text-white">

View File

@ -34,30 +34,40 @@
<img src="{{URL::asset('/images/icons/Home.svg')}}" alt="Home"> <img src="{{URL::asset('/images/icons/Home.svg')}}" alt="Home">
Home Home
</a> </a>
@if(auth()->user()->can('menuplan.show'))
<a href="{{ route("menu-plans.index") }}"> <a href="{{ route("menu-plans.index") }}">
<img src="{{URL::asset('/images/icons/Menuplan.svg')}}" alt="Menuplan"> <img src="{{URL::asset('/images/icons/Menuplan.svg')}}" alt="Menuplan">
{{ __('msg.menuplan') }} {{ __('msg.menuplan') }}
</a> </a>
@endif
@if(auth()->user()->can('event.show'))
<a href="{{ route("events.index") }}"> <a href="{{ route("events.index") }}">
<img src="{{URL::asset('/images/icons/Aktiviteter.svg')}}" alt="Aktiviteter"> <img src="{{URL::asset('/images/icons/Aktiviteter.svg')}}" alt="Aktiviteter">
{{ __('msg.aktiviteter') }} {{ __('msg.aktiviteter') }}
</a> </a>
@endif
@if(auth()->user()->can('washing.machine.reservation.show'))
<a href="{{ route("washing-reservations.appindex") }}"> <a href="{{ route("washing-reservations.appindex") }}">
<img src="{{URL::asset('/images/icons/Vaske booking liste.svg')}}" alt="Reservationer"> <img src="{{URL::asset('/images/icons/Vaske booking liste.svg')}}" alt="Reservationer">
{{ __('msg.reservationer') }} {{ __('msg.reservationer') }}
</a> </a>
@endif
@if(auth()->user()->can('contact.show'))
<a href="{{ route("contacts.index") }}"> <a href="{{ route("contacts.index") }}">
<img src="{{URL::asset('/images/icons/Kontoret.svg')}}" alt="Kontakter"> <img src="{{URL::asset('/images/icons/Kontoret.svg')}}" alt="Kontakter">
{{ __('msg.kontoret') }} {{ __('msg.kontoret') }}
</a> </a>
@endif
<a href="{{ route("phones.index") }}"> <a href="{{ route("phones.index") }}">
<img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon"> <img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon">
{{ __('msg.vagttelefon') }} {{ __('msg.vagttelefon') }}
</a> </a>
@if(auth()->user()->can('guides.show'))
<a href="{{ route("guides.index") }}"> <a href="{{ route("guides.index") }}">
<img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide"> <img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide">
{{ __('msg.vejledning') }} {{ __('msg.vejledning') }}
</a> </a>
@endif
<a href="{{ route("users.account") }}"> <a href="{{ route("users.account") }}">
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto"> <img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
{{ __('msg.konto') }} {{ __('msg.konto') }}