mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
Some minor fixes.
This commit is contained in:
parent
f565e11908
commit
3a1b1d9a15
@ -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.object.UserBelonging;
|
||||||
import com.pmease.gitop.core.permission.operation.GeneralOperation;
|
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")
|
@SuppressWarnings("serial")
|
||||||
@Entity
|
@Entity
|
||||||
@Editable
|
@Editable
|
||||||
@ -49,10 +39,8 @@ public class User extends AbstractUser implements ProtectedObject {
|
|||||||
@Column(nullable=false)
|
@Column(nullable=false)
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@Column
|
|
||||||
private String displayName;
|
private String displayName;
|
||||||
|
|
||||||
@Column
|
|
||||||
private String avatarUrl;
|
private String avatarUrl;
|
||||||
|
|
||||||
private boolean admin;
|
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
|
@Override
|
||||||
public boolean implies(Permission permission) {
|
public boolean implies(Permission permission) {
|
||||||
// Administrator can do anything
|
// Administrator can do anything
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class UserRealm extends AbstractRealm {
|
|||||||
if (userId != 0L) {
|
if (userId != 0L) {
|
||||||
return userManager.load(userId);
|
return userManager.load(userId);
|
||||||
} else {
|
} else {
|
||||||
return User.anonymous();
|
return User.ANONYMOUS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,9 @@ import com.pmease.gitop.web.SitePaths;
|
|||||||
@Path("/file")
|
@Path("/file")
|
||||||
public class TestResource {
|
public class TestResource {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static final String SUCCESS_RESPONSE = "Successful";
|
private static final String SUCCESS_RESPONSE = "Successful";
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static final String FAILED_RESPONSE = "Failed";
|
private static final String FAILED_RESPONSE = "Failed";
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user