Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
santigarcor committed Sep 27, 2017
1 parent 2c0ee36 commit 88e068e
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 283 deletions.
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
# built documents.
#
# The short X.Y version.
version = u'4.0.0'
version = u'5.0.0'
# The full version, including alpha/beta/rc tags.
release = u'4.0.0'
release = u'5.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -119,7 +119,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -344,4 +344,4 @@

# enable highlighting for PHP code not between <?php ... ?> by default
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
6 changes: 3 additions & 3 deletions docs/configuration/after_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In your ``config/laratrust.php`` file you will find all the package configuratio
Teams Feature
-------------

If you want to use the teams feature that allows you to attach roles and permissions to an user depending on a team, you must change the ``use_teams`` key value to ``true`` in your ``config/laratrust.php`` file. Then follow the :ref:`teams-configuration` configuration guide.
If you want to use the teams feature that allows you to attach roles and permissions to an user depending on a team, you must change the ``use_teams`` key value to ``true`` in your ``config/laratrust.php`` file. Then follow the :ref:`teams configuration<teams-configuration>` guide.

.. _multiple-user-models:

Expand All @@ -30,7 +30,7 @@ In the ``config/laratrust.php`` file you will find an ``user_models`` array, it
It means that there is only one user model using Laratrust, and the relationship with the ``Role`` and ``Permission`` models is going to be called like this:

.. code-block:: php
$role->users;
$role->users();
Expand All @@ -45,7 +45,7 @@ Automatic setup (Recommended)
If you want to let laratrust to setup by itself, just run the following command::

php artisan laratrust:setup

.. WARNING::
If Laravel does not recognize this command, the Laratrust service provider hasn't been registered. Check ``providers`` array in ``config/app.php`` and try clearing your configuration cache::

Expand Down
58 changes: 29 additions & 29 deletions docs/configuration/seeder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ Your ``config/laratrust_seeder.php`` file looks like this:
.. code-block:: php
return [
'role_structure' => [
'superadministrator' => [
'users' => 'c,r,u,d',
'acl' => 'c,r,u,d',
'profile' => 'r,u'
],
'administrator' => [
'users' => 'c,r,u,d',
'profile' => 'r,u'
],
'user' => [
'role_structure' => [
'superadministrator' => [
'users' => 'c,r,u,d',
'acl' => 'c,r,u,d',
'profile' => 'r,u'
],
],
'permission_structure' => [
'cru_user' => [
'profile' => 'c,r,u'
],
],
...
],
'administrator' => [
'users' => 'c,r,u,d',
'profile' => 'r,u'
],
'user' => [
'profile' => 'r,u'
],
],
'permission_structure' => [
'cru_user' => [
'profile' => 'c,r,u'
],
],
...
];
To understand the ``role_structure`` you must know:
Expand All @@ -64,11 +64,11 @@ With that in mind, you should arrange your roles, modules and permissions like t
.. code-block:: php
return [
'role_structure' => [
'role' => [
'module' => 'permissions',
],
]
'role_structure' => [
'role' => [
'module' => 'permissions',
],
]
];
To understand the ``permission_structure`` you must know:
Expand All @@ -82,14 +82,14 @@ With that in mind, you should arrange your users, modules and permissions like t
.. code-block:: php
return [
'permission_structure' => [
'user' => [
'permission_structure' => [
'user' => [
'module' => 'permissions',
],
]
],
]
];
Permissions
-----------

In case that you do not want to use the ``c,r,u,d`` permissions, in the ``config/laratrust_seeder.php`` there the ``permissions_map`` where you can change the permissions mapping.
In case that you do not want to use the ``c,r,u,d`` permissions, in the ``config/laratrust_seeder.php`` there the ``permissions_map`` where you can change the permissions mapping.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Table of Contents:
usage/index
troubleshooting
license
contributing
contributing
6 changes: 2 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Installation

php artisan config:clear

5. The :doc:`usage/middleware`\s are registered automatically as ``role``, ``permission`` and ``ability`` . If you want to change that, go to your ``config/laratrust.php`` and set the ``middleware.register`` value to ``false`` and add the following to the ``routeMiddleware`` array in ``app/Http/Kernel.php``::
5. The :doc:`middlewares </usage/middleware>` are registered automatically as ``role``, ``permission`` and ``ability`` . If you want to customize or change them, please refer to the :ref:`middleware configuration <middleware-configuration>`.


'role' => \Laratrust\Middleware\LaratrustRole::class,
'permission' => \Laratrust\Middleware\LaratrustPermission::class,
'ability' => \Laratrust\Middleware\LaratrustAbility::class,

0 comments on commit 88e068e

Please sign in to comment.