-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add units to team #947
Add units to team #947
Conversation
This is done and could be reviewed. When add/edit a team on organization, you could chose which units could be organization's repositories operated on the by this team. For example, we can define |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments
UnitTypeWiki, | ||
UnitTypeSettings, | ||
UnitTypeExternalWiki, | ||
UnitTypeExternalTracker, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need External as a separate unit? Can we enable both internal wiki and external wiki at the same time? (same for Tracker)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes. Yes, we can.
4, | ||
} | ||
|
||
UnitWiki = Unit{ | ||
UnitTypeWiki, | ||
"repo.wiki", | ||
"/wiki", | ||
"repo.wiki_desc", | ||
"repo.wiki.desc", | ||
5, | ||
} | ||
|
||
UnitExternalWiki = Unit{ | ||
UnitTypeExternalWiki, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
1, | ||
} | ||
|
||
UnitExternalTracker = Unit{ | ||
UnitTypeExternalTracker, | ||
"repo.issues", | ||
"repo.ext_issues", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
} | ||
} | ||
|
||
ctx.Handle(404, "Home", fmt.Errorf(ctx.Tr("units.error.no_unit_allowed_repo"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we leaking information that this repo exists but have nothing to show? IMO no valid Units should be the same as Private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is only for log. The UI will only show 404.
}, reqSignIn, context.RepoAssignment(), context.UnitTypes(), context.LoadRepoUnits(), context.CheckUnit(models.UnitTypeIssues)) | ||
|
||
// Releases | ||
m.Group("/:username/:reponame", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this for easy add middleware contex.CheckUnit
. Before this, releases URLs are put on many places.
LGTM |
e2da2af
to
299b4e9
Compare
models/migrations/v32.go
Outdated
return err | ||
} | ||
|
||
_, err = x.Where("1=1").Update(&Team{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an expert in xorm but can't .Where("1=1")
be removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
This need rebase. |
@sapk rebased |
I know this PR is closed, but I believe I found an issue that might be related. I think this PR modified a lot of routes related to releases, I wonder if that has anything to do with it... |
@kubatyszko could you post an issue to describe that? |
This PR allows you create one team who can only see issues or pull request or wikis.