Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: user roles management #669

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
94a60bb
feat(rbac): init user at OAuth2 login
omar-chahbouni-decathlon Oct 28, 2022
7bdf23c
feat(rbac): manage user resources access
omar-chahbouni-decathlon Nov 29, 2022
8638dc1
feat(web-ui): Added front part for admin rights and some user access …
Vincent59 Dec 12, 2022
b6952fa
feat(web-ui): The demo project is not displayed in projects list anym…
Vincent59 Dec 13, 2022
7dbd4a6
fix(rbac): enable github login
omar-chahbouni-decathlon Dec 15, 2022
8789a67
fix(rbac): enable the demo project access for authenticated users
omar-chahbouni-decathlon Dec 21, 2022
22e47b5
feat(rbac): display project creation and update details (date and user)
omar-chahbouni-decathlon Dec 25, 2022
6fa60a2
feat(rbac): link default project to each user
omar-chahbouni-decathlon Dec 27, 2022
e1d9b2c
feat(rbac): fetch user accounts
omar-chahbouni-decathlon Jan 4, 2023
7ab805d
feat(rbac): manage other users scopes
omar-chahbouni-decathlon Jan 13, 2023
50b0477
feat(web-ui): Add member projects part and fix multiple feedback
Vincent59 Jan 18, 2023
29e2e60
feat(web-ui): Add user project service to front and fix some issues
Vincent59 Jan 19, 2023
a1d1494
refactor(rbac): fetch current user details from session
omar-chahbouni-decathlon Jan 19, 2023
c8a3212
feat(rbac): update users profile
omar-chahbouni-decathlon Jan 20, 2023
260627e
feat(web-ui): Add clear default project button and projects filter
Vincent59 Jan 26, 2023
e509437
fix(web-ui): Add warn message if the user need an admin and rework pr…
Vincent59 Jan 30, 2023
ef24893
feat(rbac): add description field to projects
omar-chahbouni-decathlon Jan 28, 2023
8d079e1
fix(web-ui): Rework top menu navigation
Vincent59 Jan 31, 2023
5a16a04
refactor(rbac): change local oauth2 user profile pictures
omar-chahbouni-decathlon Jan 31, 2023
0a3a1a5
fix(web-ui): hide CTA if the user is a member
Vincent59 Feb 1, 2023
2e7a090
refactor(rbac): rename user entity related classes
omar-chahbouni-decathlon Feb 2, 2023
a783142
feat(rbac): create, read, update and read user groups
omar-chahbouni-decathlon Feb 19, 2023
1c0188e
fix(web-ui): rework UX and fix some front issues
Vincent59 Feb 17, 2023
8815645
fix(web-ui): Affect user to a project depending of the profile and is…
Vincent59 Feb 22, 2023
bc0fa67
fix(web-ui): Buttons not showing correctly
Vincent59 Feb 22, 2023
4959603
feat(rbac): manage group members and managers
omar-chahbouni-decathlon Feb 22, 2023
6b737b4
fix(rbac): return updated user account after updating its scope or pr…
omar-chahbouni-decathlon Feb 23, 2023
479e82f
feat(rbac): manage user group scopes
omar-chahbouni-decathlon Mar 1, 2023
8c6848d
feat(web-ui): group management and fix some issues
Vincent59 Mar 1, 2023
5037445
feat: add a dynamic breadcrumb on each pages, personal user page, use…
Vincent59 Mar 7, 2023
0e6e9c2
fix(web-ui): code improvment, fix breadcrumb on refresh, add elements…
Vincent59 Mar 14, 2023
6b0504e
fix(web-ui): rework group management code
Vincent59 Mar 17, 2023
e0cf0ca
feat(rbac): get the actually applied scopes from user and groups
omar-chahbouni-decathlon Mar 6, 2023
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
Prev Previous commit
Next Next commit
feat(rbac): manage group members and managers
  • Loading branch information
omar-chahbouni-decathlon committed Feb 22, 2023
commit 4959603db9f33b7cbfbf0c0d418381c777ce72f0
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.decathlon.ara.domain.Communication;
import com.decathlon.ara.domain.enumeration.CommunicationType;
import com.decathlon.ara.domain.enumeration.Technology;
import com.decathlon.ara.security.service.user.UserAccountService;
import com.decathlon.ara.security.service.member.user.account.UserAccountService;
import com.decathlon.ara.service.*;
import com.decathlon.ara.service.dto.communication.CommunicationDTO;
import com.decathlon.ara.service.dto.country.CountryDTO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.configuration;
package com.decathlon.ara.security.access;

import com.decathlon.ara.security.service.login.OAuth2UserLoginService;
import com.decathlon.ara.security.service.login.OidcUserLoginService;
import com.decathlon.ara.security.service.member.user.account.login.OAuth2UserLoginService;
import com.decathlon.ara.security.service.member.user.account.login.OidcUserLoginService;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -124,13 +124,19 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception {

// member > group
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUP_ALL_GROUPS_API_PATH).authenticated()
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUPS_CONTAINING_USER_FROM_LOGIN_API_PATH).authenticated()
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUP_MANAGED_GROUPS_FROM_USER_LOGIN_API_PATH).authenticated()
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUPS_CONTAINING_CURRENT_USER_API_PATH).authenticated()
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUP_MANAGED_GROUPS_BY_CURRENT_USER_API_PATH).authenticated()
.antMatchers(HttpMethod.POST, MEMBER_USER_GROUP_BASE_API_PATH).authenticated()
.antMatchers(HttpMethod.PUT, MEMBER_USER_GROUP_BY_ID_API_PATH).access(MEMBER_USER_GROUP_MANAGEMENT_PERMISSION)
.antMatchers(HttpMethod.DELETE, MEMBER_USER_GROUP_BY_ID_API_PATH).access(MEMBER_USER_GROUP_MANAGEMENT_PERMISSION)
// member > group > member
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUPS_CONTAINING_USER_FROM_LOGIN_API_PATH).authenticated()
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUPS_CONTAINING_CURRENT_USER_API_PATH).authenticated()
.antMatchers(HttpMethod.PUT, MEMBER_USER_GROUPS_MEMBERS_MANAGEMENT_API_PATH).access(MEMBER_USER_GROUP_MANAGEMENT_PERMISSION)
.antMatchers(HttpMethod.DELETE, MEMBER_USER_GROUPS_MEMBERS_MANAGEMENT_API_PATH).access(MEMBER_USER_GROUP_MANAGEMENT_PERMISSION)
// member > group > manager
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUP_MANAGED_GROUPS_FROM_USER_LOGIN_API_PATH).authenticated()
.antMatchers(HttpMethod.GET, MEMBER_USER_GROUP_MANAGED_GROUPS_BY_CURRENT_USER_API_PATH).authenticated()
.antMatchers(HttpMethod.PUT, MEMBER_USER_GROUPS_MANAGERS_MANAGEMENT_API_PATH).access(MEMBER_USER_GROUP_MANAGEMENT_PERMISSION)
.antMatchers(HttpMethod.DELETE, MEMBER_USER_GROUPS_MANAGERS_MANAGEMENT_API_PATH).access(MEMBER_USER_GROUP_MANAGEMENT_PERMISSION)

// projects > demo
.antMatchers(ALL_DEMO_RELATED_API_PATHS).authenticated()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.service.resource.project;
package com.decathlon.ara.security.access.project;

import com.decathlon.ara.security.dto.permission.ResourcePermission;
import com.decathlon.ara.security.service.UserSessionService;
import com.decathlon.ara.security.service.member.user.account.UserSessionService;
import com.decathlon.ara.service.ProjectService;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.service.resource.project;
package com.decathlon.ara.security.access.project;

import com.decathlon.ara.security.dto.permission.ResourcePermission;
import com.decathlon.ara.security.service.UserSessionService;
import com.decathlon.ara.security.service.member.user.account.UserSessionService;
import com.decathlon.ara.service.ProjectService;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.decathlon.ara.security.service.resource.project;
package com.decathlon.ara.security.access.project;

import com.decathlon.ara.security.dto.permission.ResourcePermission;
import com.decathlon.ara.security.dto.user.UserAccountProfile;
import com.decathlon.ara.security.dto.user.scope.UserAccountScopeRole;
import com.decathlon.ara.security.service.UserSessionService;
import com.decathlon.ara.security.service.member.user.account.UserSessionService;
import com.decathlon.ara.service.ProjectService;
import com.decathlon.ara.service.exception.ForbiddenException;
import org.apache.commons.lang3.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.service.resource.project;
package com.decathlon.ara.security.access.project;

import com.decathlon.ara.security.dto.permission.ResourcePermission;
import com.decathlon.ara.security.service.UserSessionService;
import com.decathlon.ara.security.service.member.user.account.UserSessionService;
import com.decathlon.ara.service.ProjectService;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.service.resource.project;
package com.decathlon.ara.security.access.project;

import com.decathlon.ara.security.dto.permission.ResourcePermission;
import com.decathlon.ara.security.service.UserSessionService;
import com.decathlon.ara.security.service.member.user.account.UserSessionService;
import com.decathlon.ara.service.ProjectService;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.decathlon.ara.security.configuration.data.providers;
package com.decathlon.ara.security.configuration.providers;

import com.decathlon.ara.security.configuration.data.providers.setup.ProviderSetupConfiguration;
import com.decathlon.ara.security.configuration.data.providers.setup.users.UserProfileConfiguration;
import com.decathlon.ara.security.configuration.data.providers.setup.users.UsersConfiguration;
import com.decathlon.ara.security.configuration.providers.setup.ProviderSetupConfiguration;
import com.decathlon.ara.security.configuration.providers.setup.users.UserProfileConfiguration;
import com.decathlon.ara.security.configuration.providers.setup.users.UsersConfiguration;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.configuration.data.providers.setup;
package com.decathlon.ara.security.configuration.providers.setup;

import com.decathlon.ara.security.configuration.data.providers.setup.provider.ProviderConfiguration;
import com.decathlon.ara.security.configuration.data.providers.setup.users.UsersConfiguration;
import com.decathlon.ara.security.configuration.providers.setup.provider.ProviderConfiguration;
import com.decathlon.ara.security.configuration.providers.setup.users.UsersConfiguration;

public class ProviderSetupConfiguration {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.decathlon.ara.security.configuration.data.providers.setup.provider;
package com.decathlon.ara.security.configuration.providers.setup.provider;

public class ProviderConfiguration {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.decathlon.ara.security.configuration.data.providers.setup.users;
package com.decathlon.ara.security.configuration.providers.setup.users;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.decathlon.ara.security.configuration.data.providers.setup.users;
package com.decathlon.ara.security.configuration.providers.setup.users;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.decathlon.ara.security.configuration.data.providers.setup.users;
package com.decathlon.ara.security.configuration.providers.setup.users;

import org.springframework.beans.factory.annotation.Value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.decathlon.ara.security.mapper;

import com.decathlon.ara.security.dto.authentication.user.AuthenticatedOAuth2User;
import com.decathlon.ara.security.service.user.strategy.select.UserStrategySelector;
import com.decathlon.ara.security.service.member.user.account.login.strategy.select.UserStrategySelector;
import com.decathlon.ara.service.exception.ForbiddenException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.lang.NonNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* *
******************************************************************************/

package com.decathlon.ara.security.service;
package com.decathlon.ara.security.service.member.user.account;

import com.decathlon.ara.security.configuration.data.providers.OAuth2ProvidersConfiguration;
import com.decathlon.ara.security.configuration.data.providers.setup.ProviderSetupConfiguration;
import com.decathlon.ara.security.configuration.providers.OAuth2ProvidersConfiguration;
import com.decathlon.ara.security.configuration.providers.setup.ProviderSetupConfiguration;
import com.decathlon.ara.security.dto.authentication.provider.AuthenticationProvider;
import com.decathlon.ara.security.dto.authentication.provider.AuthenticationProviders;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Loading