Repository navigation
Expand file tree
/
Copy pathinit.php
More file actions
116 lines (105 loc) · 3.09 KB
/
Copy pathinit.php
File metadata and controls
116 lines (105 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* Setting the Routes
*
* @package Gleez\Oauth2\Routing
* @author Gleez Team
* @copyright (c) 2011-2014 Gleez Technologies
* @license http://gleezcms.org/license Gleez CMS License
*/
if ( ! Route::cache())
{
//User Backend routes
Route::set('admin/oauth2', 'admin/oauth2(/<action>(/<id>))(/p<page>)', array(
'id' => '\d+',
'page' => '\d+',
'action' => 'list|add|edit|delete'
))
->defaults(array(
'directory' => 'admin',
'controller' => 'oauth2',
'action' => 'list',
));
Route::set('oauth2/provider', 'oauth2/<provider>(/<action>)', array('provider' => 'gleez|google|facebook|live|github'))
->defaults(array(
'controller' => 'provider',
'action' => 'index',
));
//oAuth2 Frontend routes
Route::set('oauth2/auth', 'oauth2/auth')
->defaults(array(
'controller' => 'authorize',
'action' => 'index',
));
Route::set('oauth2/token', 'oauth2/token')
->defaults(array(
'controller' => 'token',
'action' => 'index',
));
Route::set('oauth2/revoke', 'oauth2/revoke')
->defaults(array(
'controller' => 'revoke',
'action' => 'index',
));
Route::set('oauth2/test', 'oauth2/test(/<action>)')
->defaults(array(
'controller' => 'oauthtest',
'action' => 'coderequest',
));
Route::set('oauth2/me', 'oauth2/me(/<action>)')
->defaults(array(
'controller' => 'me',
'action' => 'index',
));
Route::set('oauth2/client', 'oauth2/client(/<action>)(/<id>)', array('id' => '\d+', 'action' => 'list|register|edit|view|delete'))
->defaults(array(
'controller' => 'client',
'action' => 'list',
));
}
/**
* Define Module specific Permissions
*
* Definition of user privileges by default if the ACL is present in the system.
* Note: Parameter `restrict access` indicates that these privileges have serious
* implications for safety.
*
* @uses ACL Used to define the privileges
*/
if ( ! ACL::cache() )
{
ACL::set('oauth2', array(
'administer oauth2' => array(
'title' => __('Administer oAuth2'),
'restrict access' => TRUE,
'description' => __('oAUth Management'),
),
'access oaclient2' => array(
'title' => __('Access Clients'),
'restrict access' => FALSE,
'description' => __('Access to all oAuth2 Clients'),
),
'edit oaclient2' => array(
'title' => __('Edit Client'),
'restrict access' => FALSE,
'description' => __('The ability to change oAuth2 Client'),
),
'edit own oaclient2' => array(
'title' => __('Change own Client'),
'restrict access' => TRUE,
'description' => __('The ability to change own oAuth2 Client'),
),
'delete oaclient2' => array(
'title' => __('Delete Client'),
'restrict access' => FALSE,
'description' => __('The ability to delete oAuth2 Client'),
),
'delete own oaclient2' => array(
'title' => __('Delete own Client'),
'restrict access' => TRUE,
'description' => __('The ability to delete own oAuth2 Client'),
)
));
/** Cache the module specific permissions in production */
ACL::cache(FALSE, Kohana::$environment === Kohana::PRODUCTION);
}