About This Repository
This repository uses PHP Laravel version 10, Javascript Vue.js version 3 and Tailwind css frameworks to implement Role Permissions management in CMS. Vite is used to compile the frontend assets. Cookie based SPA authorization feature of Laravel Sanctum package is used to authorize the user inside the content management system. Vue router is used to handle the routing and Pinia is used as the frontend store management system. If a logged user has permission to do specific task, the link to visit the task and the page containing the task will be available to the logged user. Otherwise the page will be unavailable to the logged user with 401 unauthorized error even though try to access the route manually. Though some actions are visible on the frontend for better user experience, but it will handled on the backend and shows a error toast with relevant error message as well as permission requirements. This repo utilizes the SPA feature of Vue.js.
Logging In
Following credentials can be used to log in the system
Sl | Role | Email Address | Password |
---|---|---|---|
01 | Super Admin | sadmin@sadmin.com | password |
02 | Admin | admin@admin.com | password |
03 | Author | author@author.com | password |
04 | Editor | editor@editor.com | password |
05 | User | user@user.com | password |
06 | User | user1@user.com | password |
07 | User | user2@user.com | password |
08 | User | user3@user.com | password |
09 | User | user4@user.com | password |
Initailly only Super Admin is granted all the permissions. All other role has no permissions. To add permissions to any other role, first log in as super admin, then go to the roles page. Assign necessary permissions to the role. Then come to the users page and update users roles. One user can have multiple roles. Overall user permissions will be the collection of all roles permissions combined. Super admin role is readonly(can not be edited or deleted). This role can not be applied to any other user. If a new permission is created, updated or deleted, it will be automatically applied to super admin.
Installation
First download this repository. Navigate to root of the project and then
composer install
npm install
Copy the contents of .env.example to .env file. Fill up the database credentials(DB_DATABASE, DB_USERNAME, DB_PASSWORD) according to your database. At the root of your project run the following commands on terminal sequentially.
php artisan key:generate
php artisan migrate
php artisan db:seed
This will store all the default data into the database. Then compile the assets and run development server by
npm run dev
Finally initiate your server on a new terminal and enjoy !!!
php artisan serve
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。