Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
17bfe2fe
Commit
17bfe2fe
authored
8 years ago
by
rubenwardy
Committed by
paramat
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Builtin: Add basic_privs setting
parent
30083d1e
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
builtin/game/chatcommands.lua
+6
-2
6 additions, 2 deletions
builtin/game/chatcommands.lua
builtin/settingtypes.txt
+3
-0
3 additions, 0 deletions
builtin/settingtypes.txt
doc/lua_api.txt
+1
-0
1 addition, 0 deletions
doc/lua_api.txt
minetest.conf.example
+4
-1
4 additions, 1 deletion
minetest.conf.example
with
14 additions
and
3 deletions
builtin/game/chatcommands.lua
+
6
−
2
View file @
17bfe2fe
...
...
@@ -181,8 +181,10 @@ core.register_chatcommand("grant", {
end
local
privs
=
core
.
get_player_privs
(
grantname
)
local
privs_unknown
=
""
local
basic_privs
=
core
.
string_to_privs
(
core
.
setting_get
(
"basic_privs"
)
or
"interact,shout"
)
for
priv
,
_
in
pairs
(
grantprivs
)
do
if
priv
~=
"interact"
and
priv
~=
"shout"
and
if
not
basic_privs
[
priv
]
and
not
core
.
check_player_privs
(
name
,
{
privs
=
true
})
then
return
false
,
"Your privileges are insufficient."
end
...
...
@@ -223,8 +225,10 @@ core.register_chatcommand("revoke", {
end
local
revoke_privs
=
core
.
string_to_privs
(
revoke_priv_str
)
local
privs
=
core
.
get_player_privs
(
revoke_name
)
local
basic_privs
=
core
.
string_to_privs
(
core
.
setting_get
(
"basic_privs"
)
or
"interact,shout"
)
for
priv
,
_
in
pairs
(
revoke_privs
)
do
if
priv
~=
"interact"
and
priv
~=
"shout"
and
if
not
basic_privs
[
priv
]
and
not
core
.
check_player_privs
(
name
,
{
privs
=
true
})
then
return
false
,
"Your privileges are insufficient."
end
...
...
This diff is collapsed.
Click to expand it.
builtin/settingtypes.txt
+
3
−
0
View file @
17bfe2fe
...
...
@@ -691,6 +691,9 @@ default_password (Default password) string
# See /privs in game for a full list on your server and mod configuration.
default_privs (Default privileges) string interact, shout
# Privileges that players with basic_privs can grant
basic_privs (Basic Privileges) string interact, shout
# Whether players are shown to clients without any range limit.
# Deprecated, use the setting player_transfer_distance instead.
unlimited_player_transfer_distance (Unlimited player transfer distance) bool true
...
...
This diff is collapsed.
Click to expand it.
doc/lua_api.txt
+
1
−
0
View file @
17bfe2fe
...
...
@@ -1924,6 +1924,7 @@ Call these functions only at load time!
* `minetest.register_privilege(name, definition)`
* `definition`: `"description text"`
* `definition`: `{ description = "description text", give_to_singleplayer = boolean, -- default: true }`
* To allow players with basic_privs to grant, see basic_privs minetest.conf setting.
* `minetest.register_authentication_handler(handler)`
* See `minetest.builtin_auth_handler` in `builtin.lua` for reference
...
...
This diff is collapsed.
Click to expand it.
minetest.conf.example
+
4
−
1
View file @
17bfe2fe
...
...
@@ -826,6 +826,10 @@
# type: string
# default_privs = interact, shout
# Privileges that players with basic_privs can grant
# type: string
# basic_privs = interact, shout
# Whether players are shown to clients without any range limit.
# Deprecated, use the setting player_transfer_distance instead.
# type: bool
...
...
@@ -1513,4 +1517,3 @@
# type: string
# modstore_details_url = https://forum.minetest.net/mmdb/mod/*/
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