Skip to content

Commit

Permalink
LPD-25047 auto build service
Browse files Browse the repository at this point in the history
# breaking

## What modules/apps/knowledge-base/knowledge-base-api/src/main/java/com/liferay/knowledge/base/service/KBArticleLocalService.java

Now there are 2 methods `unlockKBArticle()` replacing the previous one, and both of them need the `userId` as a parameter.

## Why

The method `unlockKBArticle(long userId, long resourcePrimKey)` needs the `userId` parameter to check for the ownership of the lock, to avoid inadvertent unlocking of a Knowledge Base Article locked by a different user. Instead, the method `unlockKBArticle(long userId, long resourcePrimKey, boolean force)` with the `force` parameter set to `true`, is used to explicitly force the unlock, no matter the owner of the lock.

----
  • Loading branch information
marcogalluzzi authored and brianchandotcom committed May 8, 2024
1 parent 2cfe6c2 commit 774ca21
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/apps/knowledge-base/knowledge-base-api/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bundle-Name: Liferay Knowledge Base API
Bundle-SymbolicName: com.liferay.knowledge.base.api
Bundle-Version: 24.0.1
Bundle-Version: 25.0.0
Export-Package:\
com.liferay.knowledge.base.configuration,\
com.liferay.knowledge.base.constants,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,10 @@ public void subscribeKBArticle(
long userId, long groupId, long resourcePrimKey)
throws PortalException;

public void unlockKBArticle(long resourcePrimKey);
public void unlockKBArticle(long userId, long resourcePrimKey);

public void unlockKBArticle(
long userId, long resourcePrimKey, boolean force);

public void unsubscribeGroupKBArticles(long userId, long groupId)
throws PortalException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,14 @@ public static void subscribeKBArticle(
getService().subscribeKBArticle(userId, groupId, resourcePrimKey);
}

public static void unlockKBArticle(long resourcePrimKey) {
getService().unlockKBArticle(resourcePrimKey);
public static void unlockKBArticle(long userId, long resourcePrimKey) {
getService().unlockKBArticle(userId, resourcePrimKey);
}

public static void unlockKBArticle(
long userId, long resourcePrimKey, boolean force) {

getService().unlockKBArticle(userId, resourcePrimKey, force);
}

public static void unsubscribeGroupKBArticles(long userId, long groupId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,15 @@ public void subscribeKBArticle(
}

@Override
public void unlockKBArticle(long resourcePrimKey) {
_kbArticleLocalService.unlockKBArticle(resourcePrimKey);
public void unlockKBArticle(long userId, long resourcePrimKey) {
_kbArticleLocalService.unlockKBArticle(userId, resourcePrimKey);
}

@Override
public void unlockKBArticle(
long userId, long resourcePrimKey, boolean force) {

_kbArticleLocalService.unlockKBArticle(userId, resourcePrimKey, force);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version 3.2.0
version 3.3.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version 13.0.0
version 14.0.0

0 comments on commit 774ca21

Please sign in to comment.