Created
June 22, 2017 16:34
-
-
Save anonymous/fa31517a284be6ef4f73a32d55f64633 to your computer and use it in GitHub Desktop.
Liferay Groovy PermissionCache Clear
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.model.User; | |
import com.liferay.portal.util.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.portal.service.ServiceContext; | |
import com.liferay.portal.security.permission.*; | |
try { | |
long companyId = PortalUtil.getDefaultCompanyId(); | |
User user = UserLocalServiceUtil.getUserByScreenName(companyId, "sasupport" ); | |
out.println("User:"+user); | |
PermissionCacheUtil.clearCache(user.getUserId()); | |
out.println("Users permissions cleared"); | |
}catch (e) { | |
out.println("Error = " + e.getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment