mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
feat: add defaultApplication for Orgnization (#1111)
* feat: add defaultApplication for Orgnization Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> * fix: remove redundant codes Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> * fix: don't use app-built-in Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> * fix: add query param Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> * Update organization.go * Update organization.go Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> Co-authored-by: Yang Luo <hsluoyz@qq.com>
This commit is contained in:
@ -121,3 +121,23 @@ func (c *ApiController) DeleteOrganization() {
|
||||
c.Data["json"] = wrapActionResponse(object.DeleteOrganization(&organization))
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
// GetDefaultApplication ...
|
||||
// @Title GetDefaultApplication
|
||||
// @Tag Organization API
|
||||
// @Description get default application
|
||||
// @Param id query string true "organization id"
|
||||
// @Success 200 {object} Response The Response object
|
||||
// @router /get-default-application [get]
|
||||
func (c *ApiController) GetDefaultApplication() {
|
||||
userId := c.GetSessionUsername()
|
||||
id := c.Input().Get("id")
|
||||
|
||||
application := object.GetMaskedApplication(object.GetDefaultApplication(id), userId)
|
||||
if application == nil {
|
||||
c.ResponseError("Please set a default application for this organization")
|
||||
return
|
||||
}
|
||||
|
||||
c.ResponseOk(application)
|
||||
}
|
||||
|
Reference in New Issue
Block a user