Download the PHP package virtualorz/permission without Composer

On this page you can find all versions of the php package virtualorz/permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package permission

Usage

Use for Laravel website to manage page permission
this package require virtualorz/sitemp and virtualorz/actionLog two packages

Install

composer require virtualorz/permission

Config

edit config/app.php

'providers' => [
    ...
    Virtualorz\Permission\PermissionServiceProvider::class
]

'aliases' => [
    ...
    'Permission' => Virtualorz\Permission\Facades\Permission::class,
]

Publish data

php artisan vendor:publish --provider="Virtualorz\Permission\PermissionServiceProvider"

Run Migration

php artisan migrate --path=/vendor/virtualorz/actionlog/src/migrations

Edit Config

edit config/permission_identity ,
for three level edit the name you want

Edit .env

edit laravel .env file on project root
add LOGINSESSION for the name store in session use for admin login on backand
add LOGINSESSION_CUSTOMER for the name store in session use for customer login on frontend
add LOGINPAGE for route name to login page
add LOGINPAGE_CUSTOMER for route name to customer login page

Usage

create middleware , in middleware call 'checkLogin' , 'checkLoginCustomer', 'checkPermission' method to check login and permission

Meiddleware Example for checkLogin

$result = Permission::checkLogin($request);

        if($result !== true){
            return $result;
        }
        else{
            return $next($request);
        }

Meiddleware Example for checkLoginCustomer

$result = Permission::checkLoginCustomer($request,['hash'=>'0098765']);

        if($result !== true){
            return $result;
        }
        else{
            return $next($request);
        }

Middleware Example for checkPermission

$result = Permission::checkPermission();

        if($result){
            return $next($request);
        }

Greate tree view in view

include in blade
<link rel="stylesheet" href="{{ asset('vendor/treeView/bootstrap-treeview.css') }}">
<script src="{{ asset('vendor/treeView/bootstrap-treeview.js') }}"></script>
<script src="{{ asset('vendor/treeView/permission_tree.js') }}"></script>

in HTML
<input type="hidden" id="tree_node" value="{{ $sitemap }}"> <!-- this to generate tree-->
<input type="hidden" name="permission" id="permission" value="[]"> <!-- thid to save tree value-->

before form submit
$("#permission").val(JSON.stringify($('#treeview').treeview('getChecked')));

in Controller, use sitemap to generate JSON
$sitemap = Sitemap::getTreeView();
$sitemap = Sitemap::routStruct('root',$sitemap);
$sitemap = json_encode($sitemap);

Method

checkLogin($request)

check admin is login or not, if login return true, if not redirect to login page set in env('LOGINPAGE')

checkLoginCustomer($request,$parameter)

check customer is login or not, if login return true, if not redirect to login page set in env('LOGINSESSION_CUSTOMER')

checkPermission

check admin has permission to use this page or not, if yes returen true, if not return abort 403 page

groupList($keyword = null,$page = 15)

return the permission group data, @$keyword for search group name, @$page for paginate per page

groupAdd($column)

return the result message for add permission group data to database, @$column['name'] for group name, @column['identity'] for identity id set in config, @$column['permission'] for permission item as array

getGroupItem($id)

retmurn the group item @$id for group item id

groupEdit($column)

return the result message for edit permission group data to database, @$column['name'] for group name, @column['identity'] for identity id set in config, @$column['permission'] for permission item as array, @$cloumn['id'] for permission edit primary id

groupDelete($column)

return the result message for delete permission group data from database, @$cloumn['id'] for permission delete primary id

permissionList($keyword = null,$page = 15)

return the permission data, @$keyword for search member name, @$page for paginate per page

getPermissionItem($id)

retmurn the member setted permission and all grops data as Array

permissionEdit($column)

return the result message for edit permission data to database, @$column['select'] for group selected as array, @$cloumn['id'] for member id

permissionDelete($column)

return the result message for delete permission data from database, @$cloumn['id'] for member id

中文版本文件

Permission : 為網站加入權限管理


All versions of permission with dependencies

PHP Build Version
Package Version
Requires virtualorz/actionlog Version ^0.0.8
virtualorz/sitemap Version ^0.0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package virtualorz/permission contains the following files

Loading the files please wait ....