
com.adobe.forms.common.utils.AuthUtils Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2015 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.adobe.forms.common.utils;
import com.adobe.granite.security.user.UserManagementService;
import org.apache.felix.scr.annotations.Reference;
public class AuthUtils {
@Reference
private static UserManagementService userManagementService;
/**
* Returns true if the user is anonymous else is logged in.
* @param userId
* @return
*/
@Deprecated
public static boolean isAnonymousLogin(String userId) {
// not using resourceResolverHelper as that is not available
// as resourceResolverHelper.getResourceResolver returns null for
// service user - in case we run IT test cases
String anonymousId = (userManagementService != null) ? userManagementService.getAnonymousId() : "anonymous";
// allow creation of directories inside /tmp/fd/af or /tmp/fd/xfaforms only
return anonymousId.equals(userId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy