mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Allow org admin to access GetResources()
This commit is contained in:
parent
27bd771fed
commit
d13a307ad5
@ -40,6 +40,15 @@ func (c *ApiController) GetResources() {
|
||||
value := c.Input().Get("value")
|
||||
sortField := c.Input().Get("sortField")
|
||||
sortOrder := c.Input().Get("sortOrder")
|
||||
|
||||
userObj, ok := c.RequireSignedInUser()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
if userObj.IsAdmin {
|
||||
user = ""
|
||||
}
|
||||
|
||||
if limit == "" || page == "" {
|
||||
c.Data["json"] = object.GetResources(owner, user)
|
||||
c.ServeJSON()
|
||||
|
@ -210,16 +210,14 @@ class ResourceListPage extends BaseListPage {
|
||||
if (record.fileType === "image") {
|
||||
return (
|
||||
<a target="_blank" rel="noreferrer" href={record.url}>
|
||||
<img src={record.url} alt={record.name} width={100} />
|
||||
<img src={record.url} alt={record.name} width={200} />
|
||||
</a>
|
||||
);
|
||||
} else if (record.fileType === "video") {
|
||||
return (
|
||||
<div>
|
||||
<video width={100} controls>
|
||||
<source src={text} type="video/mp4" />
|
||||
</video>
|
||||
</div>
|
||||
<video width={200} controls>
|
||||
<source src={record.url} type="video/mp4" />
|
||||
</video>
|
||||
);
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user