v8.0.7 2023-03-14 09:28 UTC

This package is auto-updated.

Last update: 2024-02-14 11:41:32 UTC


Install this package to apply the skyline/security package easy into your application.
It ships with a preconfiguration that you can easily adjust to your requirements.

Compiler annotations

This package extends your application compilation by another annotation compiler.
Annotations can be placed in your action controller. Everywhere else they don't affect compilation.

use Skyline\Application\Controller\AbstractActionController;

 * @annotation ....  Class annotations are valid for all action methods.
class MyActionController extends AbstractActionController {
     * @annotation ....  This annotation is only valid for the action myAction
    public function myAction() {
        // ...

This annotations are available:

  • @reliability <number or IdentityInterface::RELIABILITY_* constant> (multiple not allowed)
    Requires a minimal reliability.
  • @token <string> (multiple allowed, if one matches, condition is fulfilled)
    Requires a specific identity token name.
  • @apply-identity
    Forces to authenticate the identity.


  • @user <string> (multiple allowed, if one matches, condition is fulfilled)
    Requires a specific user by its name.
  • @group <string> (multiple allowed, if one matches, condition is fulfilled)
    Requires, that the authenticated user is member of specific group


  • @role <string> (multiple allowed, if all match, condition is fulfilled)
    Requires, that the authenticated user has a specific role

Please note that depending what you require not all security processes are performed:
If you only require a reliability and a token, no authentication is done!
See Package skyline/security for more information.

Compile DataBase

Skyline Compiler allows you the compilation flag --with-pdo.
Compiling with this flag, this package will try to create database tables that allow a fully working login system.

    Table hold all necessary information for a user, of course, you may easy extends it.
    Authorization part are roles, who has which roles to access an action.
    Users can be member of one or more groups. This also allows authorizing an action.
    Intermediate table: Which user is member of which group
    Intermediate table: Which user owns which roles
    Intermediate table: Which group owns which roles

So if a user is member or a group, the user inherits all roles assigned by the group.

Security Trait

trait SecurityTrait {
    // ....

The security trait can be used in any class that you want to access dynamically security features.