summaryrefslogtreecommitdiffstats
path: root/models/access_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix "access" fixtures and tests (#10247)guillep2k2020-02-151-1/+1
| | | | | | | | | | | | * Add fixture gen tool and fix "access" test * Close file before exiting * Add missing repo_unit for repo id: 5 * Fix count on TestAPIOrgRepos Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Restricted users (#6274)Manush Dodunekov2020-01-131-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restricted users (#4334): initial implementation * Add User.IsRestricted & UI to edit it * Pass user object instead of user id to places where IsRestricted flag matters * Restricted users: maintain access rows for all referenced repos (incl public) * Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses * Add basic repo access tests for restricted users Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Mention restricted users in the faq Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Remove unnecessary `org.IsOrganization()` call Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert to an `int64` keyed `accessMap` * Add type `userAccess` * Add convenience func updateUserAccess() * Turn accessMap into a `map[int64]userAccess` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * or even better: `map[int64]*userAccess` * updateUserAccess(): use tighter syntax as suggested by lafriks * even tighter * Avoid extra loop * Don't disclose limited orgs to unauthenticated users * Don't assume block only applies to orgs * Use an array of `VisibleType` for filtering * fix yet another thinko * Ok - no need for u * Revert "Ok - no need for u" This reverts commit 5c3e886aabd5acd997a3b35687d322439732c200. Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fixed ineffectual assignments in tests (#7553)Christian Muehlhaeuser2019-07-221-3/+3
| | | | Just makes it a bit more obvious which values we want to test for, and which ones we want to ignore.
* Add golangci (#6418)kolaente2019-06-121-7/+0
|
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-281-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
* hide issues from org private repos w/o team assignment (#4034)David Schneiderbauer2018-06-211-4/+12
|
* Remove unit types commits and settings (#2161)Lauris BH2017-07-171-2/+2
| | | | | | | | | | * Remove unit types commits and settings * Can not limit units in administrator teams * Limit changing units only to teams with read and write access mode * Small code optimization
* Refactor and fix incorrect comment (#1247)Ethan Koenig2017-03-151-8/+8
|
* Unit tests and bug fix for models/orgEthan Koenig2017-01-271-1/+1
|
* fix xorm NewSession uncorrected usages (#774)Lunny Xiao2017-01-281-12/+4
|
* Less boilerplate in models/ unit tests (#725)Ethan Koenig2017-01-251-17/+14
|
* Unit tests for models/action (#619)Ethan Koenig2017-01-091-14/+14
|
* Unit tests for models/access.go (#606)Ethan Koenig2017-01-081-0/+136