This repository has been archived by the owner on May 29, 2020. It is now read-only.
-
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.
cleanig up for transfer to friendsofcake
- Loading branch information
Showing
8 changed files
with
205 additions
and
136 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,41 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
|
||
env: | ||
global: | ||
- REPO_NAME=Authorize | ||
- PLUGIN_NAME=Authorize | ||
- REQUIRE="" | ||
|
||
matrix: | ||
- DB=mysql CAKE_VERSION=master | ||
- DB=mysql CAKE_VERSION=2.5 | ||
|
||
matrix: | ||
include: | ||
- php: 5.4 | ||
env: | ||
- DB=mysql CAKE_VERSION=master COVERALLS=1 | ||
- php: 5.4 | ||
env: | ||
- DB=mysql CAKE_VERSION=master PHPCS=1 | ||
|
||
before_script: | ||
- cd .. | ||
- git clone git://github.com/cakephp/cakephp.git --branch $CAKE_VERSION --depth 1 | ||
- cd cakephp/app | ||
- git clone https://github.com/FriendsOfCake/travis.git | ||
- ./travis/before_script.sh | ||
|
||
script: | ||
- ./travis/script.sh | ||
|
||
after_success: | ||
- ./travis/after_success.sh | ||
|
||
notifications: | ||
email: false |
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
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2013 M. Ypes, aka Ceeram | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,90 @@ | ||
# Authorize plugin | ||
|
||
Plugin containing some authorize classes for AuthComponent. | ||
|
||
Current classes: | ||
- AclAuthorize, row based Acl. AuthComponent adapter, to use together with AclBehavior created acos | ||
- HabtmDbAcl. AclComponent adapter, for User habtm Group Acl. (for database acl only) | ||
|
||
## Requirements | ||
|
||
- PHP 5.2.8 | ||
- CakePHP 2.x | ||
|
||
## Installation | ||
|
||
_[Manual]_ | ||
|
||
- Download this: http://github.com/FriendsOfCake/Authorize/zipball/master | ||
- Unzip that download. | ||
- Copy the resulting folder to app/Plugin | ||
- Rename the folder you just copied to Authorize | ||
|
||
_[GIT Submodule]_ | ||
|
||
In your app directory type: | ||
``` | ||
git submodule add git://github.com/FriedsOfCake/Authorize.git Plugin/Authorize | ||
git submodule init | ||
git submodule update | ||
``` | ||
|
||
_[GIT Clone]_ | ||
|
||
In your plugin directory type | ||
``` | ||
git clone git://github.com/FriendsOfCake/Authorize.git Authorize | ||
``` | ||
|
||
## Usage | ||
|
||
In `app/Config/bootstrap.php` add: `CakePlugin::load('Authorize');` | ||
|
||
## Configuration AclAuthorize: | ||
|
||
Setup the authorize class | ||
|
||
Example: | ||
```php | ||
//in $components | ||
public $components = array( | ||
'Auth' => array( | ||
'authorize' => array( | ||
'Controller', | ||
'Authorize.Acl' => array('actionPath' => 'Models/') | ||
) | ||
) | ||
); | ||
//Or in beforeFilter() | ||
$this->Auth->authorize = array( | ||
'Controller', | ||
'Authorize.Acl' => array('actionPath' => 'Models/') | ||
); | ||
``` | ||
In the above example `ControllerAuthorize` is checked first. If your `Controller::isAuthorized()` | ||
returns true on admin routing, AclAuthorize will only be checked for non-admin urls. | ||
Also you need to set `actionPath` in a similar way which is used with Actions- and CrudAuthorize. | ||
|
||
## Configuration HabtmDbAcl: | ||
|
||
Setup the HabtmDbAcl adapter | ||
|
||
in app/Config/core.php | ||
```php | ||
Configure::write('Acl.classname', 'Authorize.HabtmDbAcl'); | ||
``` | ||
|
||
Make sure if you need to alter settings for HabtmDbAcl, you pass those to | ||
AclComponent ``$settings['habtm']``, and have it loaded before any Auth configuration. | ||
```php | ||
//in $components | ||
public $components = array( | ||
'Acl' => array('habtm' => array( | ||
'userModel' => 'Users.User', | ||
'groupAlias' => 'Group' | ||
)), | ||
'Auth' => array( | ||
//your Auth settings | ||
) | ||
); | ||
``` |
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,22 @@ | ||
<?php | ||
/** | ||
* All tests for this plugin | ||
* | ||
* @package Cake.Test.Case.Controller.Component.Auth | ||
*/ | ||
class AllAuthorizeTest extends CakeTestCase { | ||
|
||
/** | ||
* Suite define the tests for this suite | ||
* | ||
* @return CakeTestSuite | ||
*/ | ||
public static function suite() { | ||
$suite = new CakeTestSuite('All Authorize test'); | ||
|
||
$path = CakePlugin::path('Authorize') . 'Test' . DS . 'Case' . DS; | ||
$suite->addTestDirectoryRecursive($path); | ||
|
||
return $suite; | ||
} | ||
} |
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,11 +1,29 @@ | ||
{ | ||
"name": "ceeram/Authorize", | ||
"type": "cakephp-plugin", | ||
"description": "CakePHP authorize classes for AuthComponent.", | ||
"homepage": "http://github.com/ceeram/Authorize", | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=5.3.0", | ||
"composer/installers": "*" | ||
} | ||
"name": "friendsofcake/authorize", | ||
"type": "cakephp-plugin", | ||
"description": "CakePHP plugin with authorization classes for AuthComponent.", | ||
"keywords":[ | ||
"cakephp", | ||
"authorize" | ||
], | ||
"homepage": "http://github.com/FriendsOfCake/Authorize", | ||
"authors":[ | ||
{ | ||
"name":"Ceeram", | ||
"role":"Author" | ||
} | ||
], | ||
"license": "MIT", | ||
"support":{ | ||
"source":"https://github.com/FriendsOfCake/Authorize", | ||
"issues":"https://github.com/FriendsOfCake/Authorize/issues", | ||
"irc":"irc://irc.freenode.org/friendsofcake" | ||
}, | ||
"require": { | ||
"php": ">=5.3.0", | ||
"composer/installers": "*" | ||
}, | ||
"extra": { | ||
"installer-name": "Authorize" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.