Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
81e2c332
Verified
Commit
81e2c332
authored
5 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #10733 TIME 0:20 wip admin update goupPrivilege
parent
e5766188
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lang/en.json
+6
-2
6 additions, 2 deletions
lang/en.json
lang/fr.json
+4
-1
4 additions, 1 deletion
lang/fr.json
rest/index.php
+2
-2
2 additions, 2 deletions
rest/index.php
src/app/group/controllers/GroupController.php
+6
-6
6 additions, 6 deletions
src/app/group/controllers/GroupController.php
with
18 additions
and
11 deletions
lang/en.json
+
6
−
2
View file @
81e2c332
...
@@ -171,7 +171,8 @@
...
@@ -171,7 +171,8 @@
"substitutedSignature"
:
"Substituted signature"
,
"substitutedSignature"
:
"Substituted signature"
,
"substituteMsg"
:
"You act as"
,
"substituteMsg"
:
"You act as"
,
"substitutionWarn"
:
"You choose a substitution, you will not be able to make any action."
,
"substitutionWarn"
:
"You choose a substitution, you will not be able to make any action."
,
"manage_users"
:
"User(s)"
,
"manage_users"
:
"Users"
,
"manage_usersAlt"
:
"User(s)"
,
"manage_usersDesc"
:
"Add / Update / Delete users in application."
,
"manage_usersDesc"
:
"Add / Update / Delete users in application."
,
"manage_email_configuration"
:
"Email server"
,
"manage_email_configuration"
:
"Email server"
,
"manage_email_configurationDesc"
:
"Configure email server for users notifications."
,
"manage_email_configurationDesc"
:
"Configure email server for users notifications."
,
...
@@ -191,6 +192,9 @@
...
@@ -191,6 +192,9 @@
"ok"
:
"Ok"
,
"ok"
:
"Ok"
,
"groupAdded"
:
"Group added"
,
"groupAdded"
:
"Group added"
,
"groupdeleted"
:
"Group deleted"
,
"groupdeleted"
:
"Group deleted"
,
"groupUpdated"
:
"Group updated"
"groupUpdated"
:
"Group updated"
,
"privilegeUpdated"
:
"Privilege added"
,
"removedFromGroup"
:
"User removed from group"
,
"manage_groups"
:
"Groups"
}
}
}
}
This diff is collapsed.
Click to expand it.
lang/fr.json
+
4
−
1
View file @
81e2c332
...
@@ -193,7 +193,10 @@
...
@@ -193,7 +193,10 @@
"ok"
:
"J'ai compris"
,
"ok"
:
"J'ai compris"
,
"groupAdded"
:
"Groupe ajouté"
,
"groupAdded"
:
"Groupe ajouté"
,
"groupdeleted"
:
"Groupe supprimé"
,
"groupdeleted"
:
"Groupe supprimé"
,
"groupUpdated"
:
"Groupe mis à jour"
"groupUpdated"
:
"Groupe mis à jour"
,
"privilegeUpdated"
:
"Privilège Ajouté"
,
"removedFromGroup"
:
"User removed from group"
,
"manage_groups"
:
"Groupes"
}
}
}
}
This diff is collapsed.
Click to expand it.
rest/index.php
+
2
−
2
View file @
81e2c332
...
@@ -91,8 +91,8 @@ $app->get('/groups/{id}', \Group\controllers\GroupController::class . ':getById'
...
@@ -91,8 +91,8 @@ $app->get('/groups/{id}', \Group\controllers\GroupController::class . ':getById'
$app
->
delete
(
'/groups/{id}'
,
\Group\controllers\GroupController
::
class
.
':delete'
);
$app
->
delete
(
'/groups/{id}'
,
\Group\controllers\GroupController
::
class
.
':delete'
);
$app
->
put
(
'/groups/{id}'
,
\Group\controllers\GroupController
::
class
.
':update'
);
$app
->
put
(
'/groups/{id}'
,
\Group\controllers\GroupController
::
class
.
':update'
);
$app
->
put
(
'/groups/{id}/privilege/{privilegeId}'
,
\Group\controllers\GroupController
::
class
.
':updateGroupPrivilege'
);
$app
->
put
(
'/groups/{id}/privilege/{privilegeId}'
,
\Group\controllers\GroupController
::
class
.
':updateGroupPrivilege'
);
$app
->
post
(
'/groups/{id}/
addU
ser/{userId}'
,
\Group\controllers\GroupController
::
class
.
':addUser'
);
$app
->
post
(
'/groups/{id}/
u
ser/{userId}'
,
\Group\controllers\GroupController
::
class
.
':addUser'
);
$app
->
delete
(
'/groups/{id}/
addU
ser/{userId}'
,
\Group\controllers\GroupController
::
class
.
':removeUser'
);
$app
->
delete
(
'/groups/{id}/
u
ser/{userId}'
,
\Group\controllers\GroupController
::
class
.
':removeUser'
);
//Users
//Users
$app
->
post
(
'/users'
,
\User\controllers\UserController
::
class
.
':create'
);
$app
->
post
(
'/users'
,
\User\controllers\UserController
::
class
.
':create'
);
...
...
This diff is collapsed.
Click to expand it.
src/app/group/controllers/GroupController.php
+
6
−
6
View file @
81e2c332
...
@@ -179,7 +179,7 @@ class GroupController
...
@@ -179,7 +179,7 @@ class GroupController
public
function
getById
(
Request
$request
,
Response
$response
,
array
$aArgs
)
public
function
getById
(
Request
$request
,
Response
$response
,
array
$aArgs
)
{
{
if
(
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_groups'
]))
{
if
(
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_groups'
]))
{
return
$response
->
withStatus
(
403
)
->
withJson
([
'errors'
=>
'
Servic
e forbidden'
]);
return
$response
->
withStatus
(
403
)
->
withJson
([
'errors'
=>
'
Privileg
e forbidden'
]);
}
}
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$aArgs
[
'id'
]))
{
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$aArgs
[
'id'
]))
{
...
@@ -202,7 +202,7 @@ class GroupController
...
@@ -202,7 +202,7 @@ class GroupController
public
function
addUser
(
Request
$request
,
Response
$response
,
array
$aArgs
)
public
function
addUser
(
Request
$request
,
Response
$response
,
array
$aArgs
)
{
{
if
(
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_groups'
])
&&
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_users'
]))
{
if
(
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_groups'
])
&&
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_users'
]))
{
return
$response
->
withStatus
(
403
)
->
withJson
([
'errors'
=>
'
Servic
e forbidden'
]);
return
$response
->
withStatus
(
403
)
->
withJson
([
'errors'
=>
'
Privileg
e forbidden'
]);
}
}
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$aArgs
[
'id'
]))
{
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$aArgs
[
'id'
]))
{
...
@@ -232,7 +232,7 @@ class GroupController
...
@@ -232,7 +232,7 @@ class GroupController
'objectType'
=>
'groups'
,
'objectType'
=>
'groups'
,
'objectId'
=>
$aArgs
[
'id'
],
'objectId'
=>
$aArgs
[
'id'
],
'type'
=>
'UPDATE'
,
'type'
=>
'UPDATE'
,
'message'
=>
"
{
user
a
dded
}
:
{
$user
[
'firstname'
]
}
{
$user
[
'lastname'
]
}
"
'message'
=>
"
{
user
A
dded
}
:
{
$user
[
'firstname'
]
}
{
$user
[
'lastname'
]
}
"
]);
]);
HistoryController
::
add
([
HistoryController
::
add
([
...
@@ -249,7 +249,7 @@ class GroupController
...
@@ -249,7 +249,7 @@ class GroupController
public
function
removeUser
(
Request
$request
,
Response
$response
,
array
$aArgs
)
public
function
removeUser
(
Request
$request
,
Response
$response
,
array
$aArgs
)
{
{
if
(
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_groups'
])
&&
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_users'
]))
{
if
(
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_groups'
])
&&
!
PrivilegeController
::
hasPrivilege
([
'userId'
=>
$GLOBALS
[
'id'
],
'privilege'
=>
'manage_users'
]))
{
return
$response
->
withStatus
(
403
)
->
withJson
([
'errors'
=>
'
Servic
e forbidden'
]);
return
$response
->
withStatus
(
403
)
->
withJson
([
'errors'
=>
'
Privileg
e forbidden'
]);
}
}
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$aArgs
[
'id'
]))
{
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$aArgs
[
'id'
]))
{
...
@@ -277,7 +277,7 @@ class GroupController
...
@@ -277,7 +277,7 @@ class GroupController
'objectType'
=>
'groups'
,
'objectType'
=>
'groups'
,
'objectId'
=>
$aArgs
[
'id'
],
'objectId'
=>
$aArgs
[
'id'
],
'type'
=>
'UPDATE'
,
'type'
=>
'UPDATE'
,
'message'
=>
"
{
userR
emoved
}
:
{
$user
[
'firstname'
]
}
{
$user
[
'lastname'
]
}
"
'message'
=>
"
{
r
emoved
FromGroup
}
:
{
$user
[
'firstname'
]
}
{
$user
[
'lastname'
]
}
"
]);
]);
HistoryController
::
add
([
HistoryController
::
add
([
...
@@ -285,7 +285,7 @@ class GroupController
...
@@ -285,7 +285,7 @@ class GroupController
'objectType'
=>
'users'
,
'objectType'
=>
'users'
,
'objectId'
=>
$aArgs
[
'userId'
],
'objectId'
=>
$aArgs
[
'userId'
],
'type'
=>
'UPDATE'
,
'type'
=>
'UPDATE'
,
'message'
=>
"
{
groupRemoved
}
:
{
$group
[
'label'
]
}
"
'message'
=>
"
{
removedFromGroup
}
:
{
$group
[
'label'
]
}
"
]);
]);
return
$response
->
withStatus
(
204
);
return
$response
->
withStatus
(
204
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment