Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
koko
Commits
117e5199
Commit
117e5199
authored
May 03, 2019
by
Eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify ValidateUserAssetPermission
parent
cccf0ae5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
go.mod
go.mod
+9
-7
perms.go
pkg/service/perms.go
+8
-4
No files found.
go.mod
View file @
117e5199
module cocogo
require (
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/gliderlabs/ssh v0.1.4 // indirect
github.com/ibuler/ssh v0.1.5
github.com/jarcoal/httpmock v1.0.3
github.com/konsorten/go-windows-terminal-sequences v1.0.2
github.com/kr/fs v0.1.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2
// indirect
github.com/kr/fs v0.1.0
// indirect
github.com/kr/pty v1.1.4
github.com/mattn/go-runewidth v0.0.4
github.com/leonelquinteros/gotext v1.4.0
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/olekukonko/tablewriter v0.0.1
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.8.1
// indirect
github.com/pkg/sftp v1.10.0
github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.4.1
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca
golang.org/x/crypto v0.0.0-20190424203555-c05e17bb3b2d
golang.org/x/sys v0.0.0-20190425145619-16072639606e
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734
gopkg.in/yaml.v2 v2.2.2
)
pkg/service/perms.go
View file @
117e5199
...
...
@@ -33,19 +33,23 @@ func GetUserNodes(userId, cachePolicy string) (nodes model.NodeList) {
return
}
func
ValidateUserAssetPermission
(
userId
,
assetId
,
systemUserId
string
)
bool
{
func
ValidateUserAssetPermission
(
userId
,
assetId
,
systemUserId
,
action
string
)
bool
{
params
:=
map
[
string
]
string
{
"user_id"
:
userId
,
"asset_id"
:
assetId
,
"system_user_id"
:
systemUserId
,
"
cache_policy"
:
"1"
,
"
action_name"
:
action
,
}
Url
:=
authClient
.
ParseUrlQuery
(
ValidateUserAssetPermissionURL
,
params
)
err
:=
authClient
.
Get
(
Url
,
nil
)
var
res
struct
{
Msg
bool
`json:"msg"`
}
err
:=
authClient
.
Get
(
Url
,
&
res
)
if
err
!=
nil
{
logger
.
Error
(
err
)
return
false
}
return
true
return
res
.
Msg
}
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