You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-commits@incubator.apache.org by av...@apache.org on 2010/06/06 09:09:09 UTC

svn commit: r951844 - in /incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization: Permission.java Role.java User.java UserInfo.java

Author: avd
Date: Sun Jun  6 09:09:09 2010
New Revision: 951844

URL: http://svn.apache.org/viewvc?rev=951844&view=rev
Log:
PHOTARK-20 Adding Model Objects which will be required for Authorization.

Added:
    incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Permission.java
    incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Role.java
    incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/User.java
    incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/UserInfo.java

Added: incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Permission.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Permission.java?rev=951844&view=auto
==============================================================================
--- incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Permission.java (added)
+++ incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Permission.java Sun Jun  6 09:09:09 2010
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.photark.security.authorization;
+
+/**
+ * Model representing a Permission
+ */
+public class Permission {
+	public String permission;
+	private String desc;
+	
+	/**
+	 * 
+	 * @param permission String
+	 */
+	public Permission(String permission){
+		this.permission = permission;
+	}
+	
+	
+	/**
+	 * 
+	 * @param description String
+	 */
+	public void setDescription(String description){
+		this.desc = description;
+	}
+	
+	
+	/**
+	 * 
+	 * @return String
+	 */
+	public String getPermission(){
+		return permission;
+	}
+	
+	
+	/**
+	 * 
+	 * @return String
+	 */
+	public String getPermissionDesc(){
+		return desc;
+	}
+}

Added: incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Role.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Role.java?rev=951844&view=auto
==============================================================================
--- incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Role.java (added)
+++ incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/Role.java Sun Jun  6 09:09:09 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.photark.security.authorization;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model representing a Role
+ */
+public class Role {
+	public String roleName;
+	public List<Permission> permissions = new ArrayList<Permission>();
+	
+	/**
+	 * 
+	 * @param roleName String
+	 */
+	public Role(String roleName){
+		this.roleName = roleName;
+	}
+	
+	/**
+	 * 
+	 * @param permission Permission
+	 */
+	public void setPermission(Permission permission){
+		this.permissions.add(permission);
+	}
+	
+	
+	/**
+	 * 
+	 * @return List<Permission>
+	 */
+	public List<Permission> getPermissions(){
+		return permissions;
+	}
+}

Added: incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/User.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/User.java?rev=951844&view=auto
==============================================================================
--- incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/User.java (added)
+++ incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/User.java Sun Jun  6 09:09:09 2010
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.photark.security.authorization;
+
+
+/**
+ * Model representing an User of Gallery
+ */
+public class User {
+	private String userId;
+	private UserInfo userinfo;
+	
+	/**
+	 * 
+	 * @param userId String
+	 */
+	public User(String userId){
+		this.userId = userId;
+	}
+	
+	
+	/**
+	 * 
+	 * @param userInfo UserInfo
+	 */
+	public void setUserInfo(UserInfo userInfo){
+		this.userinfo = userInfo;
+	}
+	
+	
+	/**
+	 * 
+	 * @return String
+	 */
+	public String getUserId(){
+		return userId;
+	}
+	
+	
+	/**
+	 * 
+	 * @return UserInfo
+	 */
+	public UserInfo getUserInfo(){
+		return userinfo;
+	}
+}

Added: incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/UserInfo.java
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/UserInfo.java?rev=951844&view=auto
==============================================================================
--- incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/UserInfo.java (added)
+++ incubator/photark/trunk/photark-security/src/main/java/org/apache/photark/security/authorization/UserInfo.java Sun Jun  6 09:09:09 2010
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.photark.security.authorization;
+
+/**
+ * Model representing Information of an User of Gallery
+ */
+public class UserInfo {
+	private String displayName;
+	private String email;
+	private String realName;
+	private String website;
+	
+	
+	public UserInfo(String email){
+		this.email = email;
+	}
+	
+	public String getDisplayName(){
+		return displayName;
+	}
+	
+	
+	public void setDiplayName(String  displayName){
+		this.displayName = displayName;
+	}
+	
+	public String getEmail(){
+		return email;
+	}
+	
+	
+	public String getRealName(){
+		return realName;
+	}
+	
+	public String getWebsite(){
+		return website;
+	}
+}