mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
(refs #1286) Bugfix
This commit is contained in:
@@ -78,6 +78,7 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
})
|
})
|
||||||
|
|
||||||
get("/:owner/:repository/issues/new")(readableUsersOnly { repository =>
|
get("/:owner/:repository/issues/new")(readableUsersOnly { repository =>
|
||||||
|
if(isEditable(repository)){ // TODO Should this check is provided by authenticator?
|
||||||
defining(repository.owner, repository.name){ case (owner, name) =>
|
defining(repository.owner, repository.name){ case (owner, name) =>
|
||||||
html.create(
|
html.create(
|
||||||
getAssignableUserNames(owner, name),
|
getAssignableUserNames(owner, name),
|
||||||
@@ -86,13 +87,13 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
hasWritePermission(owner, name, context.loginAccount),
|
hasWritePermission(owner, name, context.loginAccount),
|
||||||
repository)
|
repository)
|
||||||
}
|
}
|
||||||
|
} else Unauthorized()
|
||||||
})
|
})
|
||||||
|
|
||||||
post("/:owner/:repository/issues/new", issueCreateForm)(readableUsersOnly { (form, repository) =>
|
post("/:owner/:repository/issues/new", issueCreateForm)(readableUsersOnly { (form, repository) =>
|
||||||
|
if(isEditable(repository)){ // TODO Should this check is provided by authenticator?
|
||||||
defining(repository.owner, repository.name){ case (owner, name) =>
|
defining(repository.owner, repository.name){ case (owner, name) =>
|
||||||
val manageable = isManageable(repository)
|
val manageable = isManageable(repository)
|
||||||
val editable = isEditable(repository)
|
|
||||||
if(editable) {
|
|
||||||
val userName = context.loginAccount.get.userName
|
val userName = context.loginAccount.get.userName
|
||||||
|
|
||||||
// insert issue
|
// insert issue
|
||||||
@@ -129,8 +130,8 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
redirect(s"/${owner}/${name}/issues/${issueId}")
|
redirect(s"/${owner}/${name}/issues/${issueId}")
|
||||||
} else Unauthorized()
|
|
||||||
}
|
}
|
||||||
|
} else Unauthorized()
|
||||||
})
|
})
|
||||||
|
|
||||||
ajaxPost("/:owner/:repository/issues/edit_title/:id", issueTitleEditForm)(readableUsersOnly { (title, repository) =>
|
ajaxPost("/:owner/:repository/issues/edit_title/:id", issueTitleEditForm)(readableUsersOnly { (title, repository) =>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ trait RepositoryService { self: AccountService =>
|
|||||||
parentUserName = parentUserName,
|
parentUserName = parentUserName,
|
||||||
parentRepositoryName = parentRepositoryName,
|
parentRepositoryName = parentRepositoryName,
|
||||||
options = RepositoryOptions(
|
options = RepositoryOptions(
|
||||||
issuesOption = "PRIVATE", // TODO DISABLE for the forked repository?
|
issuesOption = "PUBLIC", // TODO DISABLE for the forked repository?
|
||||||
externalIssuesUrl = None,
|
externalIssuesUrl = None,
|
||||||
wikiOption = "PUBLIC", // TODO DISABLE for the forked repository?
|
wikiOption = "PUBLIC", // TODO DISABLE for the forked repository?
|
||||||
externalWikiUrl = None,
|
externalWikiUrl = None,
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ trait AdminAuthenticator { self: ControllerBase =>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows only collaborators and administrators.
|
* Allows only collaborators and administrators.
|
||||||
|
*
|
||||||
|
* TODO This authenticator should be renamed.
|
||||||
*/
|
*/
|
||||||
trait CollaboratorsAuthenticator { self: ControllerBase with RepositoryService with AccountService =>
|
trait CollaboratorsAuthenticator { self: ControllerBase with RepositoryService with AccountService =>
|
||||||
protected def collaboratorsOnly(action: (RepositoryInfo) => Any) = { authenticate(action) }
|
protected def collaboratorsOnly(action: (RepositoryInfo) => Any) = { authenticate(action) }
|
||||||
|
|||||||
@@ -15,7 +15,9 @@
|
|||||||
@if(isManageable || context.loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){
|
@if(isManageable || context.loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){
|
||||||
<a class="btn btn-default" href="#" id="edit">Edit</a>
|
<a class="btn btn-default" href="#" id="edit">Edit</a>
|
||||||
}
|
}
|
||||||
|
@if(isEditable){
|
||||||
<a class="btn btn-success" href="@helpers.url(repository)/issues/new">New issue</a>
|
<a class="btn btn-success" href="@helpers.url(repository)/issues/new">New issue</a>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="edit-title pull-right" style="display: none;">
|
<div class="edit-title pull-right" style="display: none;">
|
||||||
<a class="btn btn-success" href="#" id="update">Save</a> <a class="btn btn-default" href="#" id="cancel">Cancel</a>
|
<a class="btn btn-success" href="#" id="update">Save</a> <a class="btn btn-default" href="#" id="cancel">Cancel</a>
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<script>
|
<script><script>
|
||||||
$(function(){
|
$(function(){
|
||||||
$('#edit').click(function(){
|
$('#edit').click(function(){
|
||||||
$('.edit-title').show();
|
$('.edit-title').show();
|
||||||
|
|||||||
Reference in New Issue
Block a user