mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-04-01 09:50:16 +02:00
allow public repositories
This commit is contained in:
@@ -87,7 +87,8 @@ public class PermissionUtil
|
||||
|
||||
boolean result = false;
|
||||
|
||||
if (user.isAdmin())
|
||||
if (user.isAdmin()
|
||||
|| ((pt == PermissionType.READ) && repository.isPublicReadable()))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
/**
|
||||
@@ -61,11 +61,6 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
*/
|
||||
@XmlRootElement(name = "repositories")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(propOrder =
|
||||
{
|
||||
"id", "type", "name", "contact", "description", "creationDate",
|
||||
"lastModified", "url", "permissions"
|
||||
})
|
||||
public class Repository
|
||||
implements TypedObject, Validateable, Cloneable, Serializable
|
||||
{
|
||||
@@ -284,6 +279,17 @@ public class Repository
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPublicReadable()
|
||||
{
|
||||
return publicReadable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -377,6 +383,17 @@ public class Repository
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param publicReadable
|
||||
*/
|
||||
public void setPublicReadable(boolean publicReadable)
|
||||
{
|
||||
this.publicReadable = publicReadable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -424,6 +441,10 @@ public class Repository
|
||||
/** Field description */
|
||||
private List<Permission> permissions;
|
||||
|
||||
/** Field description */
|
||||
@XmlElement(name = "public")
|
||||
private boolean publicReadable = false;
|
||||
|
||||
/** Field description */
|
||||
private String type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user