Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
08162806
Unverified
Commit
08162806
authored
8 years ago
by
Silas Davis
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/feature-tendermint_0.8.0' into feature-tendermint_0.8.0
parents
43f2647f
5df19394
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
permission/types/permissions.go
+13
-10
13 additions, 10 deletions
permission/types/permissions.go
with
13 additions
and
10 deletions
permission/types/permissions.go
+
13
−
10
View file @
08162806
...
@@ -16,6 +16,7 @@ package types
...
@@ -16,6 +16,7 @@ package types
import
(
import
(
"fmt"
"fmt"
"strings"
"github.com/eris-ltd/eris-db/word256"
"github.com/eris-ltd/eris-db/word256"
)
)
...
@@ -237,35 +238,37 @@ func PermFlagToString(pf PermFlag) (perm string) {
...
@@ -237,35 +238,37 @@ func PermFlagToString(pf PermFlag) (perm string) {
return
return
}
}
// PermStringToFlag maps camel- and snake case strings to the
// the corresponding permission flag.
func
PermStringToFlag
(
perm
string
)
(
pf
PermFlag
,
err
error
)
{
func
PermStringToFlag
(
perm
string
)
(
pf
PermFlag
,
err
error
)
{
switch
perm
{
switch
strings
.
ToLower
(
perm
)
{
case
"root"
:
case
"root"
:
pf
=
Root
pf
=
Root
case
"send"
:
case
"send"
:
pf
=
Send
pf
=
Send
case
"call"
:
case
"call"
:
pf
=
Call
pf
=
Call
case
"create_contract"
:
case
"createcontract"
,
"create_contract"
:
pf
=
CreateContract
pf
=
CreateContract
case
"create_account"
:
case
"createaccount"
,
"create_account"
:
pf
=
CreateAccount
pf
=
CreateAccount
case
"bond"
:
case
"bond"
:
pf
=
Bond
pf
=
Bond
case
"name"
:
case
"name"
:
pf
=
Name
pf
=
Name
case
"has
B
ase"
:
case
"has
base"
,
"has_b
ase"
:
pf
=
HasBase
pf
=
HasBase
case
"set
B
ase"
:
case
"set
base"
,
"set_b
ase"
:
pf
=
SetBase
pf
=
SetBase
case
"unset
B
ase"
:
case
"unset
base"
,
"unset_b
ase"
:
pf
=
UnsetBase
pf
=
UnsetBase
case
"set
G
lobal"
:
case
"set
global"
,
"set_g
lobal"
:
pf
=
SetGlobal
pf
=
SetGlobal
case
"has
R
ole"
:
case
"has
role"
,
"has_r
ole"
:
pf
=
HasRole
pf
=
HasRole
case
"add
R
ole"
:
case
"add
role"
,
"add_r
ole"
:
pf
=
AddRole
pf
=
AddRole
case
"remove
R
ole"
:
case
"remove
role"
,
"rmrole"
,
"rm_r
ole"
:
pf
=
RmRole
pf
=
RmRole
default
:
default
:
err
=
fmt
.
Errorf
(
"Unknown permission %s"
,
perm
)
err
=
fmt
.
Errorf
(
"Unknown permission %s"
,
perm
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment