Browse Source

doc; composer.lock

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
d7275e6fea

+ 0
- 1
.gitignore View File

@@ -1,4 +1,3 @@
1 1
 /.idea
2 2
 /vendor
3
-/composer.lock
4 3
 /.env

+ 2
- 2
composer.json View File

@@ -17,10 +17,10 @@
17 17
     "require": {
18 18
       "laravel/lumen-framework": "5.1.x-dev",
19 19
       "firebase/php-jwt": "~2.0",
20
-      "luticate/utils": "*"
20
+      "luticate/utils": "dev-develop"
21 21
     },
22 22
     "require-dev": {
23
-      "luticate/generator": "*"
23
+      "luticate/generator": "dev-develop"
24 24
     },
25 25
     "autoload": {
26 26
       "psr-4": {

+ 2498
- 0
composer.lock
File diff suppressed because it is too large
View File


+ 0
- 5
src/Auth/Business/LuticateGroupsBusiness.php View File

@@ -76,9 +76,4 @@ class LuticateGroupsBusiness extends LuBusiness {
76 76
         LuticateGroupsDataAccess::editById($group_id, $group);
77 77
         return true;
78 78
     }
79
-
80
-    public static function del($group_id)
81
-    {
82
-        return LuticateGroupsDataAccess::deleteById($group_id);
83
-    }
84 79
 }

+ 34
- 1
src/Auth/Controller/LuticateGroupsController.php View File

@@ -12,31 +12,64 @@ class LuticateGroupsController extends LuController {
12 12
         return new LuticateGroupsBusiness();
13 13
     }
14 14
 
15
+    /**
16
+     * Get a group by its id
17
+     * @param $group_id int The group id
18
+     * @return \Luticate\Utils\LuDbo
19
+     */
15 20
     public function getById($group_id)
16 21
     {
17 22
         return LuticateGroupsBusiness::getById($group_id);
18 23
     }
19 24
 
25
+    /**
26
+     * Add a new group
27
+     * @param $group_name string The group name
28
+     * @return int
29
+     */
20 30
     public function add($group_name)
21 31
     {
22 32
         return LuticateGroupsBusiness::add($group_name);
23 33
     }
24 34
 
35
+    /**
36
+     * Delete a group by its id
37
+     * @param $group_id int The group id
38
+     * @return bool
39
+     */
25 40
     public function del($group_id)
26 41
     {
27
-        return LuticateGroupsBusiness::del($group_id);
42
+        return LuticateGroupsBusiness::deleteById($group_id);
28 43
     }
29 44
 
45
+    /**
46
+     * Edit a group name by its id
47
+     * @param $group_id int The group id
48
+     * @param $group_name string The new group name
49
+     * @return bool
50
+     */
30 51
     public function edit($group_id, $group_name)
31 52
     {
32 53
         return LuticateGroupsBusiness::edit($group_id, $group_name);
33 54
     }
34 55
 
56
+    /**
57
+     * Add a user to a group
58
+     * @param $user_id int The user id
59
+     * @param $group_id int The group id
60
+     * @return bool
61
+     */
35 62
     public function addUser($user_id, $group_id)
36 63
     {
37 64
         return LuticateGroupsBusiness::addUser($user_id, $group_id);
38 65
     }
39 66
 
67
+    /**
68
+     * Delete a user from a group
69
+     * @param $user_id int The user id
70
+     * @param $group_id int The group id
71
+     * @return bool
72
+     */
40 73
     public static function delUser($user_id, $group_id)
41 74
     {
42 75
         return LuticateGroupsBusiness::delUser($user_id, $group_id);

+ 35
- 0
src/Auth/Controller/LuticatePermissionsController.php View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 namespace Luticate\Auth\Controller;
4 4
 
5
+use Luticate\Auth\DBO\LuticateUsersDbo;
5 6
 use Luticate\Utils\LuController;
6 7
 use Luticate\Auth\Business\LuticatePermissionsBusiness;
7 8
 use Luticate\Auth\DBO\LuticatePermissionsDbo;
@@ -12,31 +13,65 @@ class LuticatePermissionsController extends LuController {
12 13
         return new LuticatePermissionsBusiness();
13 14
     }
14 15
 
16
+    /**
17
+     * Get the effective permission for a user
18
+     * @param $user_id int The user id
19
+     * @param $permission_name string The permission name
20
+     * @return LuticatePermissionsDbo
21
+     */
15 22
     public function getEffectivePermission($user_id, $permission_name)
16 23
     {
17 24
         return LuticatePermissionsBusiness::getEffectivePermission($user_id, $permission_name);
18 25
     }
19 26
 
27
+    /**
28
+     * Get the effective permission for the logged user
29
+     * @param $_user LuticateUsersDbo Logged user
30
+     * @param $permission_name string The permission name
31
+     * @return LuticatePermissionsDbo
32
+     */
20 33
     public function getEffectivePermissionMe($_user, $permission_name)
21 34
     {
22 35
         return LuticatePermissionsBusiness::getEffectivePermissionMe($_user, $permission_name);
23 36
     }
24 37
 
38
+    /**
39
+     * Get a permission
40
+     * @param $permission_name string The permission name
41
+     * @return \Luticate\Utils\LuDbo
42
+     */
25 43
     public function get($permission_name)
26 44
     {
27 45
         return LuticatePermissionsBusiness::get($permission_name);
28 46
     }
29 47
 
48
+    /**
49
+     * Add a permission
50
+     * @param $permission_name string The permission name
51
+     * @param $permission_value bool The default permission value
52
+     * @return bool
53
+     */
30 54
     public function add($permission_name, $permission_value)
31 55
     {
32 56
         return LuticatePermissionsBusiness::add($permission_name, $permission_value);
33 57
     }
34 58
 
59
+    /**
60
+     * Remove a permission
61
+     * @param $permission_name string The permission name
62
+     * @return bool
63
+     */
35 64
     public function del($permission_name)
36 65
     {
37 66
         return LuticatePermissionsBusiness::del($permission_name);
38 67
     }
39 68
 
69
+    /**
70
+     * Edit the default permission value
71
+     * @param $permission_name string The permission name
72
+     * @param $permission_value bool The default permission value
73
+     * @return bool
74
+     */
40 75
     public function edit($permission_name, $permission_value)
41 76
     {
42 77
         return LuticatePermissionsBusiness::edit($permission_name, $permission_value);

+ 26
- 0
src/Auth/Controller/LuticatePermissionsGroupsController.php View File

@@ -12,21 +12,47 @@ class LuticatePermissionsGroupsController extends LuController {
12 12
         return new LuticatePermissionsGroupsBusiness();
13 13
     }
14 14
 
15
+    /**
16
+     * Get a permission group
17
+     * @param $group_id int The group id
18
+     * @param $permission_name string The permission name
19
+     * @return LuticatePermissionsGroupsDbo
20
+     */
15 21
     public function get($group_id, $permission_name)
16 22
     {
17 23
         return LuticatePermissionsGroupsBusiness::get($group_id, $permission_name);
18 24
     }
19 25
 
26
+    /**
27
+     * Add a permission for a group
28
+     * @param $group_id int The group id
29
+     * @param $permission_name string The permission name
30
+     * @param $permission_value bool The permission value
31
+     * @return bool
32
+     */
20 33
     public function add($group_id, $permission_name, $permission_value)
21 34
     {
22 35
         return LuticatePermissionsGroupsBusiness::add($group_id, $permission_name, $permission_value);
23 36
     }
24 37
 
38
+    /**
39
+     * Delete a permission for a group
40
+     * @param $group_id int The group id
41
+     * @param $permission_name string The permission name
42
+     * @return bool
43
+     */
25 44
     public function del($group_id, $permission_name)
26 45
     {
27 46
         return LuticatePermissionsGroupsBusiness::del($group_id, $permission_name);
28 47
     }
29 48
 
49
+    /**
50
+     * Edit the permission value for a group
51
+     * @param $group_id int The group id
52
+     * @param $permission_name string The permission name
53
+     * @param $permission_value bool The permission value
54
+     * @return bool
55
+     */
30 56
     public function edit($group_id, $permission_name, $permission_value)
31 57
     {
32 58
         return LuticatePermissionsGroupsBusiness::edit($group_id, $permission_name, $permission_value);

+ 26
- 0
src/Auth/Controller/LuticatePermissionsUsersController.php View File

@@ -12,21 +12,47 @@ class LuticatePermissionsUsersController extends LuController {
12 12
         return new LuticatePermissionsUsersBusiness();
13 13
     }
14 14
 
15
+    /**
16
+     * Get a permission for a user
17
+     * @param $user_id int The user id
18
+     * @param $permission_name string The permission name
19
+     * @return \Luticate\Utils\LuDbo
20
+     */
15 21
     public function get($user_id, $permission_name)
16 22
     {
17 23
         return LuticatePermissionsUsersBusiness::get($user_id, $permission_name);
18 24
     }
19 25
 
26
+    /**
27
+     * Add a permission for a user
28
+     * @param $user_id int The user id
29
+     * @param $permission_name string The permission name
30
+     * @param $permission_value bool The permission value
31
+     * @return bool
32
+     */
20 33
     public function add($user_id, $permission_name, $permission_value)
21 34
     {
22 35
         return LuticatePermissionsUsersBusiness::add($user_id, $permission_name, $permission_value);
23 36
     }
24 37
 
38
+    /**
39
+     * Delete a permission for a user
40
+     * @param $user_id int The user id
41
+     * @param $permission_name string The permission name
42
+     * @return bool
43
+     */
25 44
     public function del($user_id, $permission_name)
26 45
     {
27 46
         return LuticatePermissionsUsersBusiness::del($user_id, $permission_name);
28 47
     }
29 48
 
49
+    /**
50
+     * Edit the permission value for a user
51
+     * @param $user_id int The user id
52
+     * @param $permission_name string The permission name
53
+     * @param $permission_value bool The permission value
54
+     * @return bool
55
+     */
30 56
     public function edit($user_id, $permission_name, $permission_value)
31 57
     {
32 58
         return LuticatePermissionsUsersBusiness::edit($user_id, $permission_name, $permission_value);

+ 53
- 0
src/Auth/Controller/LuticateUsersController.php View File

@@ -12,46 +12,99 @@ class LuticateUsersController extends LuController {
12 12
         return new LuticateUsersBusiness();
13 13
     }
14 14
 
15
+    /**
16
+     * Login the user
17
+     * @param $username string The user username
18
+     * @param $password string The user password
19
+     * @return LuticateUsersDbo
20
+     */
15 21
     public function login($username, $password)
16 22
     {
17 23
         return LuticateUsersBusiness::login($username, $password);
18 24
     }
19 25
 
26
+    /**
27
+     * Logout the logged user
28
+     * @param $_user LuticateUsersDbo The logged user
29
+     * @return bool
30
+     */
20 31
     public function logout($_user)
21 32
     {
22 33
         return LuticateUsersBusiness::logout($_user);
23 34
     }
24 35
 
36
+    /**
37
+     * Get a user by its id
38
+     * @param $user_id int The user id
39
+     * @return \Luticate\Utils\LuDbo
40
+     */
25 41
     public function getById($user_id)
26 42
     {
27 43
         return LuticateUsersBusiness::getById($user_id);
28 44
     }
29 45
 
46
+    /**
47
+     * Add a user
48
+     * @param $username string The new user username
49
+     * @param $email string The new user email
50
+     * @param $password string The new user plain text password
51
+     * @return int
52
+     */
30 53
     public function add($username, $email, $password)
31 54
     {
32 55
         return LuticateUsersBusiness::add($username, $email, $password);
33 56
     }
34 57
 
58
+    /**
59
+     * Delete a user by its id
60
+     * @param $user_id int The user id
61
+     * @return bool
62
+     */
35 63
     public function del($user_id)
36 64
     {
37 65
         return LuticateUsersBusiness::deleteById($user_id);
38 66
     }
39 67
 
68
+    /**
69
+     * Edit the user email for a user
70
+     * @param $email string The new user amil
71
+     * @param $user_id int The user id
72
+     * @return bool
73
+     */
40 74
     public function edit($email, $user_id)
41 75
     {
42 76
         return LuticateUsersBusiness::edit($user_id, $email);
43 77
     }
44 78
 
79
+    /**
80
+     * Edit the logged user email
81
+     * @param $email string The new user email
82
+     * @param $_user LuticateUsersDbo The logged user
83
+     * @return bool
84
+     */
45 85
     public function editMe($email, $_user)
46 86
     {
47 87
         return LuticateUsersBusiness::edit($_user->getId(), $email);
48 88
     }
49 89
 
90
+    /**
91
+     * Edit the password for a user
92
+     * @param $password string The new plain text password
93
+     * @param $user_id int The user id
94
+     * @return bool
95
+     */
50 96
     public function setPassword($password, $user_id)
51 97
     {
52 98
         return LuticateUsersBusiness::setPassword($user_id, $password);
53 99
     }
54 100
 
101
+    /**
102
+     * Edit the password for the logged user
103
+     * @param $password string The new plain text password
104
+     * @param $oldPassword string The old plain text password
105
+     * @param $_user LuticateUsersDbo The logged user
106
+     * @return bool
107
+     */
55 108
     public function setPasswordMe($password, $oldPassword, $_user)
56 109
     {
57 110
         return LuticateUsersBusiness::setPasswordMe($password, $oldPassword, $_user);

Loading…
Cancel
Save