Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Refactor of internal role hierarchy model + changes for 3.0.0 #34

Merged
merged 35 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c10ad55
Updated composer for release 2.6.0
ezimuel Feb 1, 2018
1f8a414
Updated CHANGELOG
ezimuel Feb 1, 2018
ad2ca66
Refactoring RBAC for version 3.0.0 with BC breaks
ezimuel Feb 13, 2018
238f7e5
Updated CHANGELOG
ezimuel Feb 13, 2018
4768f64
Updated README
ezimuel Feb 13, 2018
725a782
Fixing grammar
ezimuel Feb 13, 2018
a256e3b
Merge branch 'develop' into feature/release-3.0.0
ezimuel Feb 13, 2018
4a5b6e6
Requiring PHP 7.1+
ezimuel Feb 13, 2018
0a507b4
Fixed MERGE conflict
ezimuel Feb 13, 2018
a5d84cd
Fixed CHANGELOG
ezimuel Feb 13, 2018
ae79491
Fixed composer JSON format
ezimuel Feb 13, 2018
8c5bb1c
Fixed CallbackAssertion using AssertionInterface
ezimuel Feb 13, 2018
487b847
Included feedbacks from #34 + removed fluent interface + improved cod…
ezimuel Feb 14, 2018
b8bf7ea
Improving code coverage
ezimuel Feb 14, 2018
c49aa62
Updated with latest comments in #34
ezimuel Feb 19, 2018
2f528dc
Consistent capitalization with acronym
weierophinney Feb 21, 2018
3ac0f94
Corrects links in README
weierophinney Feb 21, 2018
c2c47ca
Rephrases 3.0.0 entries to refer to patches
weierophinney Feb 21, 2018
0e3c8c0
Fixes example to match updated AssertionInterface definition
weierophinney Feb 21, 2018
5c3c711
Consistent casing when presenting an acronym
weierophinney Feb 21, 2018
49ec38e
s/children/child/
weierophinney Feb 21, 2018
6f44772
Rephrase description to reflect argument order.
weierophinney Feb 21, 2018
26fc89d
Extend package-specific RuntimeException
weierophinney Feb 21, 2018
b9098a8
Remove redundant docblock annotations
weierophinney Feb 21, 2018
2e8430f
Make CallbackAssertion type-safe
weierophinney Feb 21, 2018
0f792b2
Do not wrap if line is not over length limit
weierophinney Feb 21, 2018
125f3aa
Do not wrap line if it does not exceed line limit
weierophinney Feb 21, 2018
e0ced4c
Consistency updates for Rbac class
weierophinney Feb 21, 2018
def5290
Fix method docblocks
weierophinney Feb 21, 2018
b1c91bb
Added migation guide + removed optionals in AssertionInterface
ezimuel Feb 22, 2018
6d934ce
Fixes assert() signature in CHANGELOG entry
weierophinney Feb 22, 2018
ee968a6
Fixes grammar of entry detailing circular reference fixes
weierophinney Feb 22, 2018
23275ec
Completes migration notes
weierophinney Feb 22, 2018
7a0dbf8
Added backslash for pipe in docs
ezimuel Mar 1, 2018
60bf337
Merge remote-tracking branch 'origin/feature/release-3.0.0' into feat…
ezimuel Mar 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,17 @@ env:

matrix:
include:
- php: 5.6
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- LEGACY_DEPS="phpunit/phpunit"
- php: 5.6
env:
- DEPS=latest
- TEST_COVERAGE=true
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=locked
- LEGACY_DEPS="phpunit/phpunit"
- CHECK_CS=true
- php: 7
env:
- DEPS=latest
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=locked
- CHECK_CS=true
- php: 7.1
env:
- DEPS=latest
- TEST_COVERAGE=true
- php: 7.2
env:
- DEPS=lowest
Expand Down
43 changes: 18 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,42 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.7.0 - TBD
## 3.0.0 - TBD

### Added

- Nothing.
- Check for circular references in role hierarchy when using `Role::addChild()`
and `Role::addParent()` functions.

### Changed

- Nothing.
- `Role::addChild(RoleInterface $child)`, accepts only `RoleInterface` parameter,
no string anymore.
- `Role::addParent(RoleInterface $parent)`, accepts only `RoleInterface`
parameter, no string anymore.
- `Zend\Permissions\Rbac\AssertionInterface`, added the optional parameters
`$permission` and `$role` in the `assert()` function, as follows:
`assert(Rbac $rbac, string $permission = null, RoleInterface $role = null)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the permission more likely than the role to be passed? I would have assumed this would be in the following order:

assert(Rbac $rbac, RoleInterface $role = null, string $permission = null)

For that matter: are the permission and role arguments actually optional? Will there ever be a case where they are not provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weierophinney I added $role and $permission as optional parameters because in this way we can limit BC breaks from the previous implementation. The actual interface is:

namespace Zend\Permissions\Rbac;
interface AssertionInterface
{
    /**
     * Assertion method - must return a boolean.
     *
     * @param  Rbac    $rbac
     * @return bool
     */
    public function assert(Rbac $rbac);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weierophinney I changed the order of params, using the follows:

assert(Rbac $rbac, RoleInterface $role = null, string $permission = null)


### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 2.6.1 - TBD

### Added
- [AbstractIterator](https://github.com/zendframework/zend-permissions-rbac/blob/release-2.6.0/src/AbstractIterator.php),
removed the class. The role hierarchy is not based anymore on `RecursiveIterator`.

- Nothing.
- [AbstractRole](https://github.com/zendframework/zend-permissions-rbac/blob/release-2.6.0/src/AbstractRole.php),
removed the class. All the functions have been moved in `Zend\Permissions\Rbac\Role`.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.
- `Role::setParent()`, use `Role::addParent()` instead.

### Fixed

- Nothing.
- [#30](https://github.com/zendframework/zend-permissions-rbac/issues/30), Fixed
circular references with the protected functions `Role::hasAncestor($role)`
used in `Role::addChild()` and `Role::hasDescendant($role)` in `Role::addParent()`.

## 2.6.0 - 2018-02-01

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2005-2015, Zend Technologies USA, Inc.
Copyright (c) 2005-2018, Zend Technologies USA, Inc.

All rights reserved.

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[![Build Status](https://secure.travis-ci.org/zendframework/zend-permissions-rbac.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-permissions-rbac)
[![Coverage Status](https://coveralls.io/repos/zendframework/zend-permissions-rbac/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-permissions-rbac?branch=master)

Provides role-based access control (RBAC) permissions management.
Provides [Role-based access control](https://it.wikipedia.org/wiki/Role-based_access_control)
(RBAC) permissions management.

- File issues at https://github.com/zendframework/zend-permissions-rbac
- Documentation is at https://zendframework.github.io/zend-permissions-rbac/
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "zendframework/zend-permissions-rbac",
"description": "provides a role-based access control management",
"description": "Provides a role-based access control management",
"license": "BSD-3-Clause",
"keywords": [
"zf2",
"Rbac"
"zendframework",
"zend-permssions-rbac",
"rbac",
"authorization"
],
"homepage": "https://github.com/zendframework/zend-permissions-rbac",
"autoload": {
Expand All @@ -13,14 +15,14 @@
}
},
"require": {
"php": "^5.6 || ^7.0"
"php": "^7.1"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "2.6-dev",
"dev-develop": "2.7-dev"
"dev-master": "3.0-dev",
"dev-develop": "3.1-dev"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change these until the develop branch is merged to master (i.e., right before the 3.0 release).

When you do, use the format 3.0.x-dev and 3.1.x-dev (this is the recommended format by Composer).

}
},
"autoload-dev": {
Expand All @@ -29,7 +31,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^5.7.15|| ^6.2.1",
"phpunit/phpunit": "^7.0.1",
"zendframework/zend-coding-standard": "~1.0.0"
},
"scripts": {
Expand Down
Loading