com.day.cq.security.resource.UserResource Maven / Gradle / Ivy
/*
* Copyright 1997-2008 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Day.
*/
package com.day.cq.security.resource;
import com.day.cq.security.User;
import org.apache.sling.api.resource.ResourceResolver;
/**
* @deprecated 5.4
*/
public class UserResource extends AuthorizableResource {
public UserResource(User user, String path, ResourceResolver resolver) {
super(user, path, resolver);
}
/**
* Sets the Resource-Type to com.day.cq.security.resource.User
*
* @see org.apache.sling.api.resource.Resource#getResourceType()
*/
public String getResourceType() {
return User.class.getName();
}
/**
* Sets the Resource-SuperType to com.day.cq.security.resource.AuthorizableResource
*
* @see org.apache.sling.api.resource.Resource#getResourceSuperType()
*/
public String getResourceSuperType() {
return super.getResourceType();
}
/**
* Adds adapter-support for the {@link com.day.cq.security.User User}
*
* @see org.apache.sling.api.resource.Resource#getResourceSuperType()
*/
@SuppressWarnings("unchecked")
public AdapterType adaptTo(Class type) {
if (type == User.class) {
return (AdapterType) getAuthorizable();
}
return super.adaptTo(type);
}
}