Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Application Programming Interface
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ganggo
Application Programming Interface
Commits
bd8aa8c7
Commit
bd8aa8c7
authored
Jan 10, 2018
by
zauberstuhl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change CurrentUser parameter
related to
ganggo@b92e6515
parent
563eba03
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
app/controllers/aspect.go
app/controllers/aspect.go
+3
-3
app/controllers/comment.go
app/controllers/comment.go
+1
-1
app/controllers/like.go
app/controllers/like.go
+1
-1
app/controllers/notification.go
app/controllers/notification.go
+2
-2
app/controllers/oauth.go
app/controllers/oauth.go
+1
-1
app/controllers/post.go
app/controllers/post.go
+3
-3
No files found.
app/controllers/aspect.go
View file @
bd8aa8c7
...
...
@@ -88,7 +88,7 @@ func (a ApiAspect) ShowPerson() revel.Result {
)
a
.
Params
.
Bind
(
&
personID
,
"id"
)
user
,
err
:=
models
.
CurrentUser
(
a
.
Params
,
a
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
a
.
Controller
)
if
err
!=
nil
{
a
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
a
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
@@ -216,7 +216,7 @@ func (a ApiAspect) DeletePerson() revel.Result {
}
func
(
a
ApiAspect
)
Index
(
fields
string
)
revel
.
Result
{
user
,
err
:=
models
.
CurrentUser
(
a
.
Params
,
a
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
a
.
Controller
)
if
err
!=
nil
{
a
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
a
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
@@ -283,7 +283,7 @@ func (a ApiAspect) Create() revel.Result {
return
a
.
ApiError
(
http
.
StatusBadRequest
,
ERR_EMPTY_STRING
)
}
user
,
err
:=
models
.
CurrentUser
(
a
.
Params
,
a
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
a
.
Controller
)
if
err
!=
nil
{
a
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
a
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
app/controllers/comment.go
View file @
bd8aa8c7
...
...
@@ -144,7 +144,7 @@ func (c ApiComment) Create() revel.Result {
return
c
.
ApiError
(
http
.
StatusBadRequest
,
ERR_EMPTY_STRING
)
}
user
,
err
:=
models
.
CurrentUser
(
c
.
Params
,
c
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
c
.
Controller
)
if
err
!=
nil
{
c
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
c
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
app/controllers/like.go
View file @
bd8aa8c7
...
...
@@ -169,7 +169,7 @@ func (l ApiLike) Create() revel.Result {
return
l
.
ApiError
(
http
.
StatusNotFound
,
ERR_NOT_FOUND
)
}
user
,
err
:=
models
.
CurrentUser
(
l
.
Params
,
l
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
l
.
Controller
)
if
err
!=
nil
{
l
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
l
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
app/controllers/notification.go
View file @
bd8aa8c7
...
...
@@ -84,7 +84,7 @@ type ApiNotification struct {
*
*/
func
(
n
ApiNotification
)
Index
(
fields
string
,
offset
int
)
revel
.
Result
{
user
,
err
:=
models
.
CurrentUser
(
n
)
user
,
err
:=
models
.
CurrentUser
(
n
.
Controller
)
if
err
!=
nil
{
n
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
n
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
@@ -155,7 +155,7 @@ func (n ApiNotification) Show() revel.Result {
*
*/
func
(
n
ApiNotification
)
Update
(
id
uint
)
revel
.
Result
{
user
,
err
:=
models
.
CurrentUser
(
n
.
Params
,
n
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
n
.
Controller
)
if
err
!=
nil
{
n
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
n
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
app/controllers/oauth.go
View file @
bd8aa8c7
...
...
@@ -174,7 +174,7 @@ func (o ApiOAuth) Create() revel.Result {
*/
func
(
o
ApiOAuth
)
Delete
(
id
uint
)
revel
.
Result
{
token
:=
models
.
OAuthToken
{
ID
:
id
}
user
,
err
:=
models
.
CurrentUser
(
o
.
Params
,
o
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
o
.
Controller
)
if
err
!=
nil
{
o
.
Log
.
Error
(
TAG
,
"err"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
o
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
app/controllers/post.go
View file @
bd8aa8c7
...
...
@@ -99,7 +99,7 @@ func (p ApiPost) Index() revel.Result {
p
.
Params
.
Bind
(
&
fields
,
"fields"
)
p
.
Params
.
Bind
(
&
visibility
,
"visibility"
)
user
,
err
:=
models
.
CurrentUser
(
p
.
Params
,
p
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
p
.
Controller
)
if
err
!=
nil
{
p
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
p
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
@@ -188,7 +188,7 @@ func (p ApiPost) Create() revel.Result {
return
p
.
ApiError
(
http
.
StatusBadRequest
,
ERR_EMPTY_STRING
)
}
user
,
err
:=
models
.
CurrentUser
(
p
.
Params
,
p
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
p
.
Controller
)
if
err
!=
nil
{
p
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
p
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
@@ -309,7 +309,7 @@ func (p ApiPost) Show(guid string) revel.Result {
p
.
Params
.
Bind
(
&
fields
,
"fields"
)
user
,
err
:=
models
.
CurrentUser
(
p
.
Params
,
p
.
Session
)
user
,
err
:=
models
.
CurrentUser
(
p
.
Controller
)
if
err
!=
nil
{
p
.
Log
.
Error
(
TAG
,
"db"
,
err
,
"api"
,
ERR_UNAUTHORIZED
)
return
p
.
ApiError
(
http
.
StatusUnauthorized
,
ERR_UNAUTHORIZED
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment