Fix project scheduling (#576)
* Fix project scheduling * fix comp * Fix again * Fix compile err * Fix compile err * Fix compile err * fix random err
This commit is contained in:
parent
bb80505b76
commit
5c559af936
@ -1641,8 +1641,8 @@ pub async fn project_schedule(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if user.role.is_mod()
|
if !user.role.is_mod()
|
||||||
|| team_member
|
&& !team_member
|
||||||
.map(|x| x.permissions.contains(Permissions::EDIT_DETAILS))
|
.map(|x| x.permissions.contains(Permissions::EDIT_DETAILS))
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
{
|
{
|
||||||
@ -2315,6 +2315,10 @@ pub async fn project_follow(
|
|||||||
let user_id: database::models::ids::UserId = user.id.into();
|
let user_id: database::models::ids::UserId = user.id.into();
|
||||||
let project_id: database::models::ids::ProjectId = result.id;
|
let project_id: database::models::ids::ProjectId = result.id;
|
||||||
|
|
||||||
|
if !is_authorized(&result, &Some(user), &pool).await? {
|
||||||
|
return Ok(HttpResponse::NotFound().body(""));
|
||||||
|
}
|
||||||
|
|
||||||
let following = sqlx::query!(
|
let following = sqlx::query!(
|
||||||
"
|
"
|
||||||
SELECT EXISTS(SELECT 1 FROM mod_follows mf WHERE mf.follower_id = $1 AND mf.mod_id = $2)
|
SELECT EXISTS(SELECT 1 FROM mod_follows mf WHERE mf.follower_id = $1 AND mf.mod_id = $2)
|
||||||
|
|||||||
@ -691,8 +691,8 @@ pub async fn version_schedule(
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if user.role.is_mod()
|
if !user.role.is_mod()
|
||||||
|| team_member
|
&& !team_member
|
||||||
.map(|x| x.permissions.contains(Permissions::EDIT_DETAILS))
|
.map(|x| x.permissions.contains(Permissions::EDIT_DETAILS))
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user