Created
August 13, 2020 02:52
-
-
Save techforum-repo/252793a8283e695a7d5b28875b370f89 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 javax.servlet.http.HttpServletRequest; | |
import org.apache.jackrabbit.api.security.user.User; | |
import org.osgi.service.component.annotations.Component; | |
import com.adobe.granite.oauth.server.Scope; | |
import com.adobe.granite.oauth.server.ScopeWithPrivileges; | |
@Component(service=Scope.class) | |
public class DAMWriteScope implements ScopeWithPrivileges{ | |
private static final String DAM_RESOURCE_URI="/content/dam/digital"; | |
private static final String DAM_RESOURCE_WRITE_SCOPE_NAME="dam_write"; | |
public DAMWriteScope() | |
{ | |
} | |
@Override | |
public String getDescription(HttpServletRequest arg0) { | |
return "Upload DAM Assets"; | |
} | |
@Override | |
public String getEndpoint() { | |
return null; | |
} | |
@Override | |
public String getName() { | |
return DAM_RESOURCE_WRITE_SCOPE_NAME; | |
} | |
@Override | |
public String getResourcePath(User user) { | |
return DAM_RESOURCE_URI; | |
} | |
@Override | |
public String[] getPrivileges() { | |
return new String[] {"rep:write","jcr:read"}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment