mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
(refs #8)Start to implement group management.
This commit is contained in:
@@ -60,9 +60,10 @@ trait RepositorySettingsControllerBase extends ControllerBase with FlashMapSuppo
|
||||
/**
|
||||
* JSON API for collaborator completion.
|
||||
*/
|
||||
// TODO Merge with UserManagementController
|
||||
get("/:owner/:repository/settings/collaborators/proposals")(usersOnly {
|
||||
contentType = formats("json")
|
||||
org.json4s.jackson.Serialization.write(Map("options" -> getAllUsers.map(_.userName).toArray))
|
||||
org.json4s.jackson.Serialization.write(Map("options" -> getAllUsers.filter(!_.isGroupAccount).map(_.userName).toArray))
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,5 +68,18 @@ trait UserManagementControllerBase extends AccountManagementControllerBase {
|
||||
|
||||
} getOrElse NotFound
|
||||
})
|
||||
|
||||
|
||||
get("/admin/users/_newgroup"){
|
||||
admin.users.html.group(None)
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON API for collaborator completion.
|
||||
*/
|
||||
// TODO Merge with RepositorySettingsController
|
||||
get("/admin/users/_members"){
|
||||
contentType = formats("json")
|
||||
org.json4s.jackson.Serialization.write(Map("options" -> getAllUsers.filter(!_.isGroupAccount).map(_.userName).toArray))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,8 @@ object Accounts extends Table[Account]("ACCOUNT") {
|
||||
def updatedDate = column[java.util.Date]("UPDATED_DATE")
|
||||
def lastLoginDate = column[java.util.Date]("LAST_LOGIN_DATE")
|
||||
def image = column[String]("IMAGE")
|
||||
def * = userName ~ mailAddress ~ password ~ isAdmin ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? ~ image.? <> (Account, Account.unapply _)
|
||||
def groupAccount = column[Boolean]("GROUP_ACCOUNT")
|
||||
def * = userName ~ mailAddress ~ password ~ isAdmin ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? ~ image.? ~ groupAccount <> (Account, Account.unapply _)
|
||||
}
|
||||
|
||||
case class Account(
|
||||
@@ -24,5 +25,6 @@ case class Account(
|
||||
registeredDate: java.util.Date,
|
||||
updatedDate: java.util.Date,
|
||||
lastLoginDate: Option[java.util.Date],
|
||||
image: Option[String]
|
||||
image: Option[String],
|
||||
isGroupAccount: Boolean
|
||||
)
|
||||
|
||||
@@ -24,7 +24,8 @@ trait AccountService {
|
||||
registeredDate = currentDate,
|
||||
updatedDate = currentDate,
|
||||
lastLoginDate = None,
|
||||
image = None)
|
||||
image = None,
|
||||
isGroupAccount = false)
|
||||
|
||||
def updateAccount(account: Account): Unit =
|
||||
Accounts
|
||||
|
||||
Reference in New Issue
Block a user