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: Refactoring of CurrentUserService and introduction of UserDetails and more #15727

Merged
merged 143 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 130 commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
b8b7e0f
feat: upgrade to Spring 6
netroms Nov 16, 2023
bac10b3
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 17, 2023
5e993f5
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Nov 17, 2023
cf27a0d
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 17, 2023
f8c3322
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 17, 2023
7bcdd88
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 17, 2023
31a91fc
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 20, 2023
f1d6eb1
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Nov 20, 2023
6e9f4bd
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 21, 2023
cfe4799
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Nov 21, 2023
51c9da8
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 24, 2023
1188bf8
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 24, 2023
ebeb68b
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Nov 24, 2023
b511a76
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 24, 2023
7412881
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 24, 2023
0774efc
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 27, 2023
7753fd5
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Nov 27, 2023
5549711
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 27, 2023
fa10f2a
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 28, 2023
8ffe40d
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 28, 2023
2a00613
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Nov 28, 2023
820008d
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 28, 2023
5080701
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 28, 2023
7306448
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 28, 2023
d176298
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 29, 2023
e1088e8
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 29, 2023
f799d82
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 30, 2023
15d5520
feat: Migrate away from deprecated Spring Security configuration
netroms Nov 30, 2023
0ebb0bd
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 1, 2023
859e9b9
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 1, 2023
d12c917
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 1, 2023
7972846
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 1, 2023
fcddc55
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 1, 2023
11ed376
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 4, 2023
b62161b
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 5, 2023
dbbd327
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 5, 2023
1cdff28
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 5, 2023
47d2d48
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 5, 2023
63b72cf
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 5, 2023
7dd48c2
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 5, 2023
6163c6e
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 6, 2023
18812f9
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
e525a3c
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
71c1155
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
72d386d
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
e33f796
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
08acbf4
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
de629b0
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 6, 2023
0f42647
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
d798dd3
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
ac6ea6e
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 6, 2023
5129e77
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
cf94d68
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 6, 2023
f73600b
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 7, 2023
738e0ce
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 8, 2023
bb7ec4f
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 8, 2023
0c94399
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 11, 2023
cffd5a7
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 11, 2023
7f70f94
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 11, 2023
5a79e64
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 11, 2023
c54133a
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 11, 2023
83e2874
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 11, 2023
eb29d00
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 11, 2023
c7864d5
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 11, 2023
154f44c
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
f67e691
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 12, 2023
943edae
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
25893b0
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
0cbbbff
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
34ac34d
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
fd53fd8
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
edcf118
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 12, 2023
313d020
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 12, 2023
5582578
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 12, 2023
8f17084
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
c994ecf
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 13, 2023
6eb1977
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
e210624
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
489d530
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
0035fb2
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
99ca77b
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
34130c3
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
490ee24
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 13, 2023
5e06971
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
9511a5f
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 13, 2023
b4036ed
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 18, 2023
d943e7e
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 18, 2023
efa1e55
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 18, 2023
6965817
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 18, 2023
acdb711
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 18, 2023
7821c30
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 18, 2023
d8111bc
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 18, 2023
e96523a
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 18, 2023
3878fcd
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 19, 2023
2850ed5
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 19, 2023
fe9054c
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 19, 2023
9bc9cc5
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 19, 2023
0b1a8ef
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 19, 2023
66845a7
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 19, 2023
3ed365f
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 20, 2023
099762e
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 20, 2023
6e19257
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 20, 2023
e46e514
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 20, 2023
d9d6abb
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 20, 2023
dc2ac81
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 20, 2023
cad081e
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 20, 2023
2f35912
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 21, 2023
5b23ebf
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 21, 2023
57a7012
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 21, 2023
d8ff11c
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 22, 2023
85f0f34
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Dec 22, 2023
52d762f
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 22, 2023
be56c69
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 22, 2023
b9f422c
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 22, 2023
ef9b692
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 22, 2023
3b06857
feat: Migrate away from deprecated Spring Security configuration
netroms Dec 23, 2023
00e01d5
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 5, 2024
3cada37
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 5, 2024
9cebcc1
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 5, 2024
0dee335
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 5, 2024
4413148
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 5, 2024
e863948
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 5, 2024
2adf7e3
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 5, 2024
334591b
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 8, 2024
bd85560
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 8, 2024
ddce543
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 8, 2024
93c4a7e
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 8, 2024
67f4f99
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 9, 2024
188f6b8
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 9, 2024
bc9725b
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 9, 2024
44f11a5
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 10, 2024
ed06e9b
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 10, 2024
8e7db87
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 10, 2024
6158438
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 10, 2024
f12e8ed
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 11, 2024
88f80dd
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 11, 2024
3ff3bd6
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 11, 2024
cc44756
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 11, 2024
ab02eb9
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 11, 2024
c0aeb7a
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 11, 2024
e7b60db
Merge branch 'master' of github.com:dhis2/dhis2-core into DHIS2-16169…
netroms Jan 11, 2024
f1f234e
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 11, 2024
1ab6228
feat: Migrate away from deprecated Spring Security configuration
netroms Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@

import java.util.List;
import org.hisp.dhis.common.IdentifiableObjectStore;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;

/**
* @author Lars Helge Overland
*/
public interface CategoryOptionStore extends IdentifiableObjectStore<CategoryOption> {
List<CategoryOption> getCategoryOptions(Category category);

List<CategoryOption> getDataWriteCategoryOptions(Category category, User user);
List<CategoryOption> getDataWriteCategoryOptions(Category category, UserDetails userDetails);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.hisp.dhis.dataelement.DataElementOperand;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;

/**
* @author Abyot Asalefew
Expand All @@ -55,13 +56,17 @@ public interface CategoryService {
*/
long addCategory(Category category);

long addCategory(Category category, UserDetails actingUser);

/**
* Updates a Category.
*
* @param category the Category to update.
*/
void updateCategory(Category category);

void updateCategory(Category category, UserDetails actingUser);

/**
* Deletes a Category. The Category is also removed from any CategoryCombos if it is a member of.
* It is not possible to delete a Category with options.
Expand Down Expand Up @@ -143,13 +148,17 @@ public interface CategoryService {
*/
long addCategoryOption(CategoryOption dataElementCategoryOption);

long addCategoryOption(CategoryOption dataElementCategoryOption, UserDetails actingUser);

/**
* Updates a CategoryOption.
*
* @param dataElementCategoryOption the CategoryOption to update.
*/
void updateCategoryOption(CategoryOption dataElementCategoryOption);

void updateCategoryOption(CategoryOption dataElementCategoryOption, UserDetails actingUser);

/**
* Deletes a CategoryOption.
*
Expand Down Expand Up @@ -203,7 +212,7 @@ public interface CategoryService {
* @param user to check data write access for
* @return a list of all CategoryOptions, or an empty collection if there are no CategoryOptions.
*/
List<CategoryOption> getDataWriteCategoryOptions(Category category, User user);
List<CategoryOption> getDataWriteCategoryOptions(Category category, UserDetails user);

/**
* Returns a set of CategoryOptions that may be seen by the current user, if the current user has
Expand Down Expand Up @@ -236,13 +245,17 @@ SetValuedMap<String, String> getCategoryOptionOrganisationUnitsAssociations(
*/
long addCategoryCombo(CategoryCombo dataElementCategoryCombo);

long addCategoryCombo(CategoryCombo dataElementCategoryCombo, UserDetails actingUser);

/**
* Updates a CategoryCombo.
*
* @param dataElementCategoryCombo the CategoryCombo to update.
*/
void updateCategoryCombo(CategoryCombo dataElementCategoryCombo);

void updateCategoryCombo(CategoryCombo dataElementCategoryCombo, UserDetails actingUser);

/**
* Deletes a CategoryCombo.
*
Expand Down Expand Up @@ -328,13 +341,19 @@ SetValuedMap<String, String> getCategoryOptionOrganisationUnitsAssociations(
*/
long addCategoryOptionCombo(CategoryOptionCombo dataElementCategoryOptionCombo);

long addCategoryOptionCombo(
CategoryOptionCombo dataElementCategoryOptionCombo, UserDetails actingUser);

/**
* Updates a CategoryOptionCombo.
*
* @param dataElementCategoryOptionCombo the CategoryOptionCombo to update.
*/
void updateCategoryOptionCombo(CategoryOptionCombo dataElementCategoryOptionCombo);

void updateCategoryOptionCombo(
CategoryOptionCombo dataElementCategoryOptionCombo, UserDetails actingUser);

/**
* Deletes a CategoryOptionCombo.
*
Expand Down Expand Up @@ -388,7 +407,7 @@ CategoryOptionCombo getCategoryOptionCombo(
* Generates and persists a default Category, CategoryOption, CategoryCombo and
* CategoryOptionCombo.
*/
void generateDefaultDimension();
void generateDefaultDimension(UserDetails actingUser);

/**
* Retrieves the default CategoryOptionCombo.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
import org.hisp.dhis.trackedentity.TrackedEntityDataElementDimension;
import org.hisp.dhis.trackedentity.TrackedEntityProgramIndicatorDimension;
import org.hisp.dhis.translation.Translatable;
import org.hisp.dhis.user.CurrentUserDetails;
import org.hisp.dhis.user.CurrentUserUtil;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;
import org.hisp.dhis.visualization.DefaultValue;
import org.hisp.dhis.visualization.LegendDefinitions;

Expand Down Expand Up @@ -1655,7 +1655,7 @@ public void setSubscribers(@CheckForNull Set<String> subscribers) {
@JsonProperty
@JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
public boolean isSubscribed() {
CurrentUserDetails user = CurrentUserUtil.getCurrentUserDetails();
UserDetails user = CurrentUserUtil.getCurrentUserDetails();
return (user != null && subscribers != null) && subscribers.contains(user.getUid());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
import org.hisp.dhis.security.acl.Access;
import org.hisp.dhis.translation.Translatable;
import org.hisp.dhis.translation.Translation;
import org.hisp.dhis.user.CurrentUserDetails;
import org.hisp.dhis.user.CurrentUserUtil;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;
import org.hisp.dhis.user.UserSettingKey;
import org.hisp.dhis.user.sharing.Sharing;
import org.hisp.dhis.user.sharing.UserAccess;
Expand Down Expand Up @@ -417,7 +417,7 @@ public void setFavorites(Set<String> favorites) {
@JsonProperty
@JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
public boolean isFavorite() {
CurrentUserDetails user = CurrentUserUtil.getCurrentUserDetails();
UserDetails user = CurrentUserUtil.getCurrentUserDetails();
return user != null && favorites != null && favorites.contains(user.getUid());
}

Expand All @@ -438,7 +438,7 @@ public void setSharing(Sharing sharing) {
}

@Override
public boolean setAsFavorite(User user) {
public boolean setAsFavorite(UserDetails user) {
if (this.favorites == null) {
this.favorites = new HashSet<>();
}
Expand All @@ -447,7 +447,7 @@ public boolean setAsFavorite(User user) {
}

@Override
public boolean removeAsFavorite(User user) {
public boolean removeAsFavorite(UserDetails user) {
if (this.favorites == null) {
this.favorites = new HashSet<>();
}
Expand Down Expand Up @@ -499,7 +499,7 @@ public final boolean typedEquals(IdentifiableObject other) {

/** Set auto-generated fields on save or update */
public void setAutoFields() {
if (uid == null || uid.length() == 0) {
if (uid == null || uid.isEmpty()) {
setUid(CodeGenerator.generateUid());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.Map;
import java.util.Set;
import org.hisp.dhis.feedback.NotFoundException;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;

/**
* @author Lars Helge Overland
Expand All @@ -45,9 +45,8 @@ public interface DimensionService {
*/
List<DimensionalItemObject> getCanReadDimensionItems(String uid);

<T extends IdentifiableObject> List<T> getCanReadObjects(List<T> objects);

<T extends IdentifiableObject> List<T> getCanReadObjects(User user, List<T> objects);
<T extends IdentifiableObject> List<T> filterReadableObjects(
UserDetails userDetails, List<T> objects);

DimensionType getDimensionType(String uid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.hisp.dhis.security.acl.Access;
import org.hisp.dhis.translation.Translation;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;
import org.hisp.dhis.user.sharing.Sharing;

/**
Expand Down Expand Up @@ -64,9 +65,9 @@ public interface IdentifiableObject

boolean isFavorite();

boolean setAsFavorite(User user);
boolean setAsFavorite(UserDetails user);

boolean removeAsFavorite(User user);
boolean removeAsFavorite(UserDetails user);

// -----------------------------------------------------------------------------
// Sharing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.hisp.dhis.feedback.ErrorCode;
import org.hisp.dhis.translation.Translation;
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.UserDetails;

/**
* @author Lars Helge Overland
Expand All @@ -55,16 +56,12 @@ public interface IdentifiableObjectManager {

void update(@Nonnull IdentifiableObject object);

void update(@Nonnull IdentifiableObject object, @CheckForNull User user);
void update(@Nonnull IdentifiableObject object, UserDetails currentUserDetails);

void update(@Nonnull List<IdentifiableObject> objects);

void update(@Nonnull List<IdentifiableObject> objects, @CheckForNull User user);

void delete(@Nonnull IdentifiableObject object);

void delete(@Nonnull IdentifiableObject object, @CheckForNull User user);

/**
* Lookup objects of unknown type.
*
Expand Down Expand Up @@ -192,7 +189,7 @@ <T extends IdentifiableObject> T getByUniqueAttributeValue(
@Nonnull Class<T> type,
@Nonnull Attribute attribute,
@Nonnull String value,
@CheckForNull User userInfo);
@CheckForNull String username);
Dismissed Show dismissed Hide dismissed

@CheckForNull
<T extends IdentifiableObject> T search(@Nonnull Class<T> type, @Nonnull String query);
Expand Down Expand Up @@ -389,4 +386,8 @@ List<String> getUidsCreatedBefore(

@Nonnull
<T extends IdentifiableObject> List<T> getAllNoAcl(@Nonnull Class<T> type);

void persist(Object userAdmin);

User find(Class<User> userClass, long id);
}
Loading
Loading