mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
remove repository public flag
This commit is contained in:
@@ -113,7 +113,6 @@ public abstract class AbstactImportHandler implements AdvancedImportHandler
|
|||||||
Repository repository = new Repository();
|
Repository repository = new Repository();
|
||||||
|
|
||||||
repository.setName(repositoryName);
|
repository.setName(repositoryName);
|
||||||
repository.setPublicReadable(false);
|
|
||||||
repository.setType(getTypeName());
|
repository.setType(getTypeName());
|
||||||
|
|
||||||
return repository;
|
return repository;
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
@XmlElement(name = "permission")
|
@XmlElement(name = "permission")
|
||||||
private Set<RepositoryPermission> permissions = new HashSet<>();
|
private Set<RepositoryPermission> permissions = new HashSet<>();
|
||||||
@XmlElement(name = "public")
|
@XmlElement(name = "public")
|
||||||
private boolean publicReadable = false;
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
@@ -225,15 +224,6 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
return Util.isEmpty(healthCheckFailures);
|
return Util.isEmpty(healthCheckFailures);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the {@link Repository} is public readable.
|
|
||||||
*
|
|
||||||
* @return true if the {@link Repository} is public readable
|
|
||||||
*/
|
|
||||||
public boolean isPublicReadable() {
|
|
||||||
return publicReadable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the {@link Repository} is valid.
|
* Returns true if the {@link Repository} is valid.
|
||||||
* <ul>
|
* <ul>
|
||||||
@@ -292,10 +282,6 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
return this.permissions.remove(permission);
|
return this.permissions.remove(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPublicReadable(boolean publicReadable) {
|
|
||||||
this.publicReadable = publicReadable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
@@ -332,7 +318,6 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
repository.setLastModified(lastModified);
|
repository.setLastModified(lastModified);
|
||||||
repository.setDescription(description);
|
repository.setDescription(description);
|
||||||
repository.setPermissions(permissions);
|
repository.setPermissions(permissions);
|
||||||
repository.setPublicReadable(publicReadable);
|
|
||||||
|
|
||||||
// do not copy health check results
|
// do not copy health check results
|
||||||
}
|
}
|
||||||
@@ -360,7 +345,6 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
&& Objects.equal(name, other.name)
|
&& Objects.equal(name, other.name)
|
||||||
&& Objects.equal(contact, other.contact)
|
&& Objects.equal(contact, other.contact)
|
||||||
&& Objects.equal(description, other.description)
|
&& Objects.equal(description, other.description)
|
||||||
&& Objects.equal(publicReadable, other.publicReadable)
|
|
||||||
&& Objects.equal(permissions, other.permissions)
|
&& Objects.equal(permissions, other.permissions)
|
||||||
&& Objects.equal(type, other.type)
|
&& Objects.equal(type, other.type)
|
||||||
&& Objects.equal(creationDate, other.creationDate)
|
&& Objects.equal(creationDate, other.creationDate)
|
||||||
@@ -371,7 +355,7 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(id, namespace, name, contact, description, publicReadable,
|
return Objects.hashCode(id, namespace, name, contact, description,
|
||||||
permissions, type, creationDate, lastModified, properties,
|
permissions, type, creationDate, lastModified, properties,
|
||||||
healthCheckFailures);
|
healthCheckFailures);
|
||||||
}
|
}
|
||||||
@@ -384,7 +368,6 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
|||||||
.add("name", name)
|
.add("name", name)
|
||||||
.add("contact", contact)
|
.add("contact", contact)
|
||||||
.add("description", description)
|
.add("description", description)
|
||||||
.add("publicReadable", publicReadable)
|
|
||||||
.add("permissions", permissions)
|
.add("permissions", permissions)
|
||||||
.add("type", type)
|
.add("type", type)
|
||||||
.add("lastModified", lastModified)
|
.add("lastModified", lastModified)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ public abstract class RepositoryDtoToRepositoryMapper extends BaseDtoMapper {
|
|||||||
|
|
||||||
@Mapping(target = "creationDate", ignore = true)
|
@Mapping(target = "creationDate", ignore = true)
|
||||||
@Mapping(target = "id", ignore = true)
|
@Mapping(target = "id", ignore = true)
|
||||||
@Mapping(target = "publicReadable", ignore = true)
|
|
||||||
@Mapping(target = "healthCheckFailures", ignore = true)
|
@Mapping(target = "healthCheckFailures", ignore = true)
|
||||||
public abstract Repository map(RepositoryDto repositoryDto, @Context String id);
|
public abstract Repository map(RepositoryDto repositoryDto, @Context String id);
|
||||||
|
|
||||||
|
|||||||
@@ -168,8 +168,7 @@ public class AuthorizationChangedEventProducer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAuthorizationDataModified(Repository repository, Repository beforeModification) {
|
private boolean isAuthorizationDataModified(Repository repository, Repository beforeModification) {
|
||||||
return repository.isPublicReadable() != beforeModification.isPublicReadable()
|
return !(repository.getPermissions().containsAll(beforeModification.getPermissions()) && beforeModification.getPermissions().containsAll(repository.getPermissions()));
|
||||||
|| !(repository.getPermissions().containsAll(beforeModification.getPermissions()) && beforeModification.getPermissions().containsAll(repository.getPermissions()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fireEventForEveryUser() {
|
private void fireEventForEveryUser() {
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ public class MigrateVerbsToPermissionRoles implements UpdateStep {
|
|||||||
repository.setCreationDate(oldRepository.creationDate);
|
repository.setCreationDate(oldRepository.creationDate);
|
||||||
repository.setHealthCheckFailures(oldRepository.healthCheckFailures);
|
repository.setHealthCheckFailures(oldRepository.healthCheckFailures);
|
||||||
repository.setLastModified(oldRepository.lastModified);
|
repository.setLastModified(oldRepository.lastModified);
|
||||||
repository.setPublicReadable(oldRepository.publicReadable);
|
|
||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user