Author: tyrell
Date: Sat Jan 12 18:31:58 2008
New Revision: 12163
Log:
Obtaining the mashup author from the path instead of the registry.
Modified:
trunk/mashup/java/modules/www/editor.jsp
Modified: trunk/mashup/java/modules/www/editor.jsp
==============================================================================
--- trunk/mashup/java/modules/www/editor.jsp (original)
+++ trunk/mashup/java/modules/www/editor.jsp Sat Jan 12 18:31:58 2008
@@ -56,8 +56,15 @@
throw new Exception(
"Sorry. An edit request was made without a valid mashup being
named for editing.");
} else if ((action.equalsIgnoreCase("edit")) && (mashup != null)) {
- Resource resource = registry.get(mashup);
- String author = resource.getAuthorUserName();
+ String[] pathContents = mashup.split("/");
+
+ String author = "";
+ if (pathContents.length < 4) {
+ throw new Exception("Sorry. The path specified for the mashup is
invalid.");
+ } else {
+ author = pathContents[2];
+ }
+
if (!((author.equalsIgnoreCase(currentUser) ||
RegistryUtils.isAdminRole(registry)))) {
throw new Exception(
"Sorry. You are not authorized to perform this
operation.");
@@ -72,7 +79,7 @@
<!--Do not cache -->
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="expires" content=<%= new java.util.Date() %>>
-
+
<title>Mashup Editor</title>
<!-- Required CSS -->
<link href="css/styles.css" rel="stylesheet" type="text/css"/>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev