mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-11-03 20:15:52 +01:00 
			
		
		
		
	Create fine-grained configuration permissions.
No more hard-coded isAdmin() checks.
This commit is contained in:
		@@ -39,6 +39,7 @@ 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.XmlTransient;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
@@ -46,7 +47,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 | 
			
		||||
 */
 | 
			
		||||
@XmlRootElement(name = "config")
 | 
			
		||||
@XmlAccessorType(XmlAccessType.FIELD)
 | 
			
		||||
public class GitConfig extends SimpleRepositoryConfig {
 | 
			
		||||
public class GitConfig extends RepositoryConfig {
 | 
			
		||||
  
 | 
			
		||||
  @XmlElement(name = "gc-expression")
 | 
			
		||||
  private String gcExpression;
 | 
			
		||||
@@ -55,5 +56,11 @@ public class GitConfig extends SimpleRepositoryConfig {
 | 
			
		||||
  {
 | 
			
		||||
    return gcExpression;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  @XmlTransient // Only for permission checks, don't serialize to XML
 | 
			
		||||
  public String getId() {
 | 
			
		||||
    // Don't change this without migrating SCM permission configuration!
 | 
			
		||||
    return "git";
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user