PHPackages                             mouf/security.rightsservice-splash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. mouf/security.rightsservice-splash

ActiveLibrary[Security](/categories/security)

mouf/security.rightsservice-splash
==================================

This package contains a set of class to bind the Splash MVC framework (&gt;=v4) with the RightsService component. It features: a @RequiresRight annotation to restrict access to logged users only.

v10.0.2(3y ago)065.1k53MITPHPPHP ^8.0

Since Jun 26Pushed 3y ago2 watchersCompare

[ Source](https://github.com/thecodingmachine/security.rightsservice-splash)[ Packagist](https://packagist.org/packages/mouf/security.rightsservice-splash)[ Docs](https://github.com/thecodingmachine/security.rightsservice-splash)[ RSS](/packages/mouf-securityrightsservice-splash/feed)WikiDiscussions 10.0 Synced 3w ago

READMEChangelog (5)Dependencies (3)Versions (9)Used By (3)

Integrating the "rightsservice" with Splash
===========================================

[](#integrating-the-rightsservice-with-splash)

This package is part of the Mouf PHP framework and contains the @Right annotation that integrates the [Splash MVC framework](http://mouf-php.com/packages/mouf/mvc.splash/index.md) with the [RightsService](http://mouf-php.com/packages/mouf/security.rightsservice/README.md).

This package provides one useful filter:

The **@Right** annotation
-------------------------

[](#the-right-annotation)

This filter can be used in any action. If you put this annotation, the user will be denied access if he does not possess the specified right.

```
/**
 * A sample default action that requires to have the "ACCESS_ADMIN_RIGHT" right.
 *
 * @URL /admin
 * @Right("ACCESS_ADMIN_RIGHT")
 */
public function index() { ... }
```

The **@Right** annotation requires an instance of `ForbiddenMiddleware` to exist. The name of the instance must be `ForbiddenMiddleware::class`. If your `ForbiddenMiddleware` instance is not named `ForbiddenMiddleware::class` (or if you want to use several ForbiddenMiddleware instances, you can specify the instance of middleware to use in parameter of the annotation:

```
/**
 * A sample default action that requires to have the "ACCESS_ADMIN_RIGHT" right.
 *
 * @URL /admin
 * @Right(name="ACCESS_ADMIN_RIGHT",instance="myForbiddenMiddleware")
 */
public function index() { ... }
```

Composite rights: the **@AndRight** and **@OrRight** annotations
----------------------------------------------------------------

[](#composite-rights-the-andright-and-orright-annotations)

Occasionally, you might want to check if a user has 2 rights (**and**), or one of two rights (**or**).

To do this, instead of passing a string to the @Right annotation, you can pass a @AndRight or a @OrRight annotation.

For instance, to check that a user has both the CAN\_DO\_THIS and CAN\_DO\_THAT rights, you should use:

```
/**
 * An action that requires to have both the "CAN_DO_THIS" and "CAN_DO_THAT" right.
 *
 * @URL /admin
 * @Right(@AndRight({@Right("CAN_DO_THIS"), @Right("CAN_DO_THAT")}))
 */
public function index() { ... }
```

If instead, you want to check that a user has one right amongst many, you would use the @OrRight:

```
/**
 * An action that requires to have either the "CAN_DO_THIS" or "CAN_DO_THAT" right.
 *
 * @URL /admin
 * @Right(@OrRight({@Right("CAN_DO_THIS"), @Right("CAN_DO_THAT")}))
 */
public function index() { ... }
```

You can also combine @AndRight and @OrRight annotations as long as the top-most annotation is a @Right. Also, if you need to combine complex rights, you should probably start to question your right system and refactor it. @AndRight and @OrRight should really be used sparsely.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 61.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~340 days

Recently: every ~399 days

Total

9

Last Release

1295d ago

Major Versions

4.0.x-dev → 8.0.x-dev2018-07-25

8.0.x-dev → v10.0.0-beta.12018-07-25

PHP version history (3 changes)v4.0.0PHP &gt;=5.3.0

8.0.x-devPHP &gt;=7.0.0

v10.0.1PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (21 commits)")[![nguyenk](https://avatars.githubusercontent.com/u/2227554?v=4)](https://github.com/nguyenk "nguyenk (7 commits)")[![homersimpsons](https://avatars.githubusercontent.com/u/16977446?v=4)](https://github.com/homersimpsons "homersimpsons (2 commits)")[![xhuberty](https://avatars.githubusercontent.com/u/8350192?v=4)](https://github.com/xhuberty "xhuberty (2 commits)")[![Jfb77](https://avatars.githubusercontent.com/u/209118712?v=4)](https://github.com/Jfb77 "Jfb77 (1 commits)")[![vaidiep](https://avatars.githubusercontent.com/u/2227695?v=4)](https://github.com/vaidiep "vaidiep (1 commits)")

---

Tags

securitymoufsplashrights

### Embed Badge

![Health badge](/badges/mouf-securityrightsservice-splash/health.svg)

```
[![Health](https://phpackages.com/badges/mouf-securityrightsservice-splash/health.svg)](https://phpackages.com/packages/mouf-securityrightsservice-splash)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k455.2M1.5k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k170.7M239](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M134](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41582.2M138](/packages/robrichards-xmlseclibs)[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

86110.6M23](/packages/spatie-laravel-csp)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33932.8M125](/packages/enlightn-security-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
