Some minor fixes.

This commit is contained in:
robin shine 2013-09-29 20:56:18 +08:00
parent f565e11908
commit 3a1b1d9a15
3 changed files with 3 additions and 20 deletions

View File

@ -24,16 +24,6 @@ import com.pmease.gitop.core.permission.object.ProtectedObject;
import com.pmease.gitop.core.permission.object.UserBelonging;
import com.pmease.gitop.core.permission.operation.GeneralOperation;
/**
* This class represents either a project or an user in the system.
* <p>
* In Gitop, users and projects are the same thing.
* If necessary, you can always treat an user account as a project account.
* {@link Project} and {@link Team} are always created under a specific account.
*
* @author robin
*
*/
@SuppressWarnings("serial")
@Entity
@Editable
@ -49,10 +39,8 @@ public class User extends AbstractUser implements ProtectedObject {
@Column(nullable=false)
private String email;
@Column
private String displayName;
@Column
private String avatarUrl;
private boolean admin;
@ -217,13 +205,6 @@ public class User extends AbstractUser implements ProtectedObject {
}
}
public static User anonymous() {
User user = new User();
user.setId(0L);
user.setName("Guest");
return user;
}
@Override
public boolean implies(Permission permission) {
// Administrator can do anything

View File

@ -30,7 +30,7 @@ public class UserRealm extends AbstractRealm {
if (userId != 0L) {
return userManager.load(userId);
} else {
return User.anonymous();
return User.ANONYMOUS;
}
}

View File

@ -28,7 +28,9 @@ import com.pmease.gitop.web.SitePaths;
@Path("/file")
public class TestResource {
@SuppressWarnings("unused")
private static final String SUCCESS_RESPONSE = "Successful";
@SuppressWarnings("unused")
private static final String FAILED_RESPONSE = "Failed";
@POST