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
27480073
Unverified
Commit
27480073
authored
7 years ago
by
Casey Kuhlman
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #710 from silasdavis/perm-docs
Add some more useful comments in permissions.go
parents
3ae2d611
62cd25be
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/permissions.go
+32
-11
32 additions, 11 deletions
permission/permissions.go
with
32 additions
and
11 deletions
permission/permissions.go
+
32
−
11
View file @
27480073
...
...
@@ -26,16 +26,36 @@ import (
// Base permission references are like unix (the index is already bit shifted)
const
(
// chain permissions
Root
types
.
PermFlag
=
1
<<
iota
// 1
Send
// 2
Call
// 4
CreateContract
// 8
CreateAccount
// 16
Bond
// 32
Name
// 64
// moderator permissions
// Chain permissions.
// These permissions grant the ability for accounts to perform certain transition within the execution package
// Root is a reserved permission currently unused that may be used in the future to grant super-user privileges
// for instance to a governance contract
Root
types
.
PermFlag
=
1
<<
iota
// 1
// Send permits an account to issue a SendTx to transfer value from one account to another. Note that value can
// still be transferred with a CallTx by specifying an Amount in the InputTx. Funding an account is the basic
// prerequisite for an account to act in the system so is often used as a surrogate for 'account creation' when
// sending to a unknown account - in order for this to be permitted the input account needs the CreateAccount
// permission in addition.
Send
// 2
// Call permits and account to issue a CallTx, which can be used to call (run) the code of an existing
// account/contract (these are synonymous in Burrow/EVM). A CallTx can be used to create an account if it points to
// a nil address - in order for an account to be permitted to do this the input (calling) account needs the
// CreateContract permission in addition.
Call
// 4
// CreateContract permits the input account of a CallTx to create a new contract/account when CallTx.Address is nil
// and permits an executing contract in the EVM to create a new contract programmatically.
CreateContract
// 8
// CreateAccount permits an input account of a SendTx to add value to non-existing (unfunded) accounts
CreateAccount
// 16
// Bond is a reserved permission for making changes to the validator set - currently unused
Bond
// 32
// Name permits manipulation of the name registry by allowing an account to issue a NameTx
Name
// 64
// Moderator permissions.
// These permissions concern the alteration of the chain permissions listed above. Each permission relates to a
// particular canonical permission mutation or query function. When an account is granted a moderation permission
// it is permitted to call that function. See snative.go for a marked-up description of what each function does.
HasBase
SetBase
UnsetBase
...
...
@@ -50,6 +70,7 @@ const (
AllPermFlags
types
.
PermFlag
=
TopPermFlag
|
(
TopPermFlag
-
1
)
DefaultPermFlags
types
.
PermFlag
=
Send
|
Call
|
CreateContract
|
CreateAccount
|
Bond
|
Name
|
HasBase
|
HasRole
// Chain permissions strings
RootString
string
=
"root"
SendString
=
"send"
CallString
=
"call"
...
...
@@ -58,7 +79,7 @@ const (
BondString
=
"bond"
NameString
=
"name"
//
m
oderator permissions
//
M
oderator permissions
strings
HasBaseString
=
"hasBase"
SetBaseString
=
"setBase"
UnsetBaseString
=
"unsetBase"
...
...
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