-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from visto9259/3_docs
Moving documenation to Docusaurus built GitHub pages
- Loading branch information
Showing
35 changed files
with
9,031 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and Deploy to GitHub Pages | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
|
||
jobs: | ||
deploy: | ||
name: Build and Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
cache-dependency-path: docs/yarn.lock | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Build website | ||
run: yarn build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Build output to publish to the `gh-pages` branch: | ||
publish_dir: ./docs/build | ||
# The following lines assign commit authorship to the official | ||
# GH-Actions bot for deploys to `gh-pages` branch: | ||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
# The GH actions bot is used by default if you didn't specify the two fields. | ||
# You can swap them out with your own user credentials. | ||
user_name: github-actions[bot] | ||
user_email: 41898282+github-actions[bot]@users.noreply.github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Build GitHub Pages on PRs No Deploy | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'docs/**' | ||
# Review gh actions docs if you want to further define triggers, paths, etc | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | ||
|
||
jobs: | ||
test-deploy: | ||
name: Build GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
cache-dependency-path: docs/yarn.lock | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Test build website | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
node_modules | ||
|
||
# Production | ||
build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,41 @@ | ||
Welcome to the official LmcRbacMvc documentation. This documentation will help you quickly understand how to use | ||
and extend LmcRbacMvc. | ||
|
||
If you are looking for some information that is not listed in the documentation, please open an issue! | ||
|
||
1. [Introduction](01.%20Introduction.md) | ||
1. [Why should I use an authorization module?](01.%20Introduction.md#why-should-i-use-an-authorization-module) | ||
2. [What is the Rbac model?](01.%20Introduction.md#what-is-the-rbac-model) | ||
3. [How can I integrate LmcRbacMvc into my application?](01.%20Introduction.md#how-can-i-integrate-lmcrbacmvc-into-my-application) | ||
|
||
2. [Quick Start](02.%20Quick%20Start.md) | ||
1. [Specifying an identity provider](02.%20Quick%20Start.md#specifying-an-identity-provider) | ||
2. [Adding a guard](02.%20Quick%20Start.md#adding-a-guard) | ||
3. [Adding a role provider](02.%20Quick%20Start.md#adding-a-role-provider) | ||
5. [Registering a strategy](02.%20Quick%20Start.md#registering-a-strategy) | ||
6. [Using the authorization service](02.%20Quick%20Start.md#using-the-authorization-service) | ||
|
||
3. [Role providers](03.%20Role%20providers.md) | ||
1. [What are role providers?](03.%20Role%20providers.md#what-are-role-providers) | ||
2. [Identity providers](03.%20Role%20providers.md#identity-providers) | ||
3. [Built-in role providers](03.%20Role%20providers.md#built-in-role-providers) | ||
4. [Creating custom role providers](03.%20Role%20providers.md#creating-custom-role-providers) | ||
|
||
4. [Guards](04.%20Guards.md) | ||
1. [What are guards and when to use them?](04.%20Guards.md#what-are-guards-and-when-should-you-use-them) | ||
2. [Built-in guards](04.%20Guards.md#built-in-guards) | ||
3. [Creating custom guards](04.%20Guards.md#creating-custom-guards) | ||
|
||
5. [Strategies](05.%20Strategies.md) | ||
1. [What are strategies?](05.%20Strategies.md#what-are-strategies) | ||
2. [Built-in strategies](05.%20Strategies.md#built-in-strategies) | ||
3. [Creating custom strategies](05.%20Strategies.md#creating-custom-strategies) | ||
|
||
6. [Using the Authorization Service](06.%20Using%20the%20Authorization%20Service.md) | ||
1. [Injecting the AuthorizationService](06.%20Using%20the%20Authorization%20Service.md#injecting-the-authorization-service) | ||
2. [Checking permissions](06.%20Using%20the%20Authorization%20Service.md#checking-permissions-in-a-service) | ||
1. [In a service](06.%20Using%20the%20Authorization%20Service.md#checking-permissions-in-a-service) | ||
2. [In a controller's action using the isGranted controller plugin](06.%20Using%20the%20Authorization%20Service.md#in-a-controller-) | ||
3. [In a view using the isGranted view helper](06.%20Using%20the%20Authorization%20Service.md#in-a-view-) | ||
3. [Permissions and Assertions](06.%20Using%20the%20Authorization%20Service.md#permissions-and-assertions) | ||
|
||
7. [Cookbook](07.%20Cookbook.md) | ||
1. [A real world example](07.%20Cookbook.md#a-real-world-application) | ||
2. [Best practices](07.%20Cookbook.md#best-practices) | ||
3. [Using LmcRbacMvc with Doctrine ORM](07.%20Cookbook.md#using-lmcrbacmvc-with-doctrine-orm) | ||
4. [How to deal with roles with lot of permissions?](07.%20Cookbook.md#how-to-deal-with-roles-with-lot-of-permissions) | ||
5. [Using LmcRbacMvc and ZF2 Assetic](07.%20Cookbook.md#using-lmcrbacmvc-and-zf2-assetic) | ||
6. [Using LmcRbacMvc and LmcUser](07.%20Cookbook.md#using-lmcrbacmvc-and-lmcuser) | ||
# Website | ||
|
||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
slug: welcome | ||
title: Welcome | ||
authors: [ericr] | ||
tags: [laminas, PHP] | ||
--- | ||
Welcome to the new documentation website for the LM-Commons organization. | ||
|
||
This site is work in progress and the intent is obviously to keep it current with updates to the LM-Commons packages. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
slug: new-documentation | ||
title: New documentation | ||
authors: [ericr] | ||
tags: [laminas, PHP, lmcrbacmvc] | ||
--- | ||
This the new documentation site dedicated to the LmcRbacMvc module. | ||
|
||
There are no changes to the code, just improvements in the documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ericr: | ||
name: Eric Richer | ||
title: LM-Commons Administrator | ||
url: https://github.com/visto9259 | ||
image_url: https://github.com/visto9259.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
sidebar_position: 2 | ||
sidebar_label: Requirements and Installation | ||
--- | ||
# Requirements and Installation | ||
## Requirements | ||
|
||
- PHP 7.4 or higher | ||
- [Zf-fr/Rbac component v1](https://github.com/zf-fr/rbac): this is actually a prototype for the ZF3 Rbac component. | ||
- [Laminas Components 2.x | 3.x or higher](http://www.github.com/laminas) | ||
|
||
|
||
## Optional | ||
|
||
- [DoctrineModule](https://github.com/doctrine/DoctrineModule): if you want to use some built-in role and permission providers. | ||
- [Laminas\DeveloperTools](https://github.com/laminas/Laminas\DeveloperTools): if you want to have useful stats added to | ||
the Laminas Developer toolbar. | ||
|
||
|
||
## Installation | ||
|
||
LmcRbacMvc only officially supports installation through Composer. For Composer documentation, please refer to | ||
[getcomposer.org](http://getcomposer.org/). | ||
|
||
Install the module: | ||
|
||
```sh | ||
$ composer require lm-commons/lmc-rbac-mvc:^3.0 | ||
``` | ||
|
||
Enable the module by adding `LmcRbacMvc` key to your `application.config.php` or `modules.config.php` file. Customize the module by copy-pasting | ||
the `lmc_rbac.global.php.dist` file to your `config/autoload` folder. | ||
|
||
## Upgrade | ||
|
||
LmcRbacMvc introduces breaking changes from zfcrbac v2: | ||
- [BC] The namespace has been changed from `ZfcRbac` to `LmcRbacMvc`. | ||
- [BC] The key `zfc_rbac` in autoload and module config files has been replaced | ||
by the `lmc_rbac` key. | ||
- Requires PHP 7.4 or later | ||
- Requires Laminas MVC components 3.x or later | ||
- Uses PSR-4 autoload |
Oops, something went wrong.