Added a new extremely simple test WebPermission.

This commit is contained in:
Relintai 2022-08-25 21:26:08 +02:00
parent 3dbe3ac71f
commit 013ec29a8e
3 changed files with 16 additions and 1 deletions

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=11 format=2]
[gd_scene load_steps=12 format=2]
[ext_resource path="res://Main.gd" type="Script" id=1]
[ext_resource path="res://addons/web_pages/classes/WebPage.gd" type="Script" id=2]
[ext_resource path="res://addons/web_pages/classes/post_entries/WebPageEntryTitleText.gd" type="Script" id=3]
[ext_resource path="res://addons/web_pages/classes/post_entries/WebPageEntryText.gd" type="Script" id=4]
[ext_resource path="res://addons/web_pages/classes/post_entries/WebPageEntryImage.gd" type="Script" id=5]
[ext_resource path="res://web_perm_test/new_webpermission.tres" type="WebPermission" id=6]
[sub_resource type="Resource" id=1]
script = ExtResource( 3 )
@ -57,6 +58,7 @@ data = "<a href=\"/page\">Page</a>"
[node name="page" type="WebNode" parent="WebRoot"]
uri_segment = "page"
web_permission = ExtResource( 6 )
script = ExtResource( 2 )
allow_web_interface_editing = true
entries = [ SubResource( 1 ), SubResource( 4 ), SubResource( 5 ), SubResource( 3 ), SubResource( 2 ) ]

View File

@ -0,0 +1,6 @@
extends WebPermission
export(int, FLAGS, "VIEW", "CREATE", "EDIT", "DELETE") var permissions : int = 1
func _get_permissions(request : WebServerRequest):
return permissions

View File

@ -0,0 +1,7 @@
[gd_resource type="WebPermission" load_steps=2 format=2]
[ext_resource path="res://web_perm_test/WebPermTest.gd" type="Script" id=1]
[resource]
script = ExtResource( 1 )
permissions = 15