Skip to content

Commit 38c2a10

Browse files
committed
ACL functions
1 parent 9b3e90d commit 38c2a10

File tree

81 files changed

+1426
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1426
-75
lines changed

functions/ACL/aclCreate.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclCreate
21
server:
32
name: aclCreate
4-
description: TODO
5-
incomplete: true
3+
description: This function creates an [[ACL]] entry in the Access Control List system with the specified name.
4+
oop:
5+
element: ACL
6+
constructorclass: ACL
7+
parameters:
8+
- name: aclName
9+
type: string
10+
description: The name of the [[ACL]] entry to add.
11+
returns:
12+
values:
13+
- type: acl|false
14+
name: acl object
15+
description: Returns the created [[ACL]] object if successful. Returns false if an ACL of the given name could not be created.
16+
examples:
17+
- path: examples/aclCreate-1.lua
18+
description: This example adds a command <code>setaclright</code> with which you can easily add new rights to specified access control lists.
19+
- path: examples/aclCreate_OOP-1.lua
20+
description: This example adds a command <code>setaclright</code> with which you can easily add new rights to specified access control lists.
21+
oop: true

functions/ACL/aclCreateGroup.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclCreateGroup
21
server:
32
name: aclCreateGroup
4-
description: TODO
5-
incomplete: true
3+
description: This function creates a group in the [[ACL]]. An [[ACL]] group can contain objects like players and resources. They specify who has access to the ACL's in this group.
4+
oop:
5+
element: ACLGroup
6+
constructorclass: ACLGroup
7+
parameters:
8+
- name: groupName
9+
type: string
10+
description: The name of the group to create.
11+
returns:
12+
values:
13+
- type: aclgroup|false
14+
name: acl group
15+
description: Returns the pointer to the created aclgroup if successful. Returns false if failed.
16+
examples:
17+
- path: examples/aclCreateGroup-1.lua
18+
description: This example adds a command <code>addobjecttogroup</code> with which you can easily add new objects to specified access control list groups.
19+
- path: examples/aclCreateGroup_OOP-1.lua
20+
description: This example adds a command <code>addobjecttogroup</code> with which you can easily add new objects to specified access control list groups.
21+
oop: true
22+

functions/ACL/aclDestroy.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclDestroy
21
server:
32
name: aclDestroy
4-
description: TODO
5-
incomplete: true
3+
description: This function destroys the [[ACL]] passed. The destroyed ACL will no longer be valid.
4+
oop:
5+
element: acl
6+
method: destroy
7+
parameters:
8+
- name: theACL
9+
type: acl
10+
description: The ACL to destroy.
11+
returns:
12+
values:
13+
- type: bool
14+
name: resullt
15+
description: Returns true if successfully destroyed and false if it could not be deleted (ie. it's not valid).
16+
examples:
17+
- path: examples/aclDestroy-1.lua
18+
description: This example shows you a command to delete an ACL.
19+
- path: examples/aclDestroy_OOP-1.lua
20+
description: This example shows you a command to delete an ACL.
21+
oop: true

functions/ACL/aclDestroyGroup.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclDestroyGroup
21
server:
32
name: aclDestroyGroup
4-
description: TODO
5-
incomplete: true
3+
description: This function destroys the given [[ACL]] group. The destroyed ACL group will no longer be valid.
4+
oop:
5+
element: aclgroup
6+
method: destroy
7+
parameters:
8+
- name: aclGroup
9+
type: aclgroup
10+
description: The [[aclgroup]] element to destroy.
11+
returns:
12+
values:
13+
- type: bool
14+
name: result
15+
description: Returns true if the ACL group was successfully deleted, false if it could not be deleted for some reason (ie. invalid argument).
16+
examples:
17+
- path: examples/aclDestroyGroup-1.lua
18+
description: This example allows admins to remove an ACL group they specify.
19+
- path: examples/aclDestroyGroup_OOP-1.lua
20+
description: This example allows admins to remove an ACL group they specify.
21+
oop: true

functions/ACL/aclGet.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclGet
21
server:
32
name: aclGet
4-
description: TODO
5-
incomplete: true
3+
description: Get the [[ACL]] with the given name. If need to get most of the ACL's, you should consider using [[aclList]] to get a table of them all.
4+
oop:
5+
element: ACL
6+
method: get
7+
static: true
8+
parameters:
9+
- name: aclName
10+
type: string
11+
description: The name to get the ACL belonging to.
12+
returns:
13+
values:
14+
- type: acl|false
15+
name: acl
16+
description: Returns the [[ACL]] with that name if it could be retrieved, false/nil if the ACL does not exist or it fails for some other reason.
17+
examples:
18+
- path: examples/aclGet-1.lua
19+
description: This example adds a command <code>setaclright</code> with which you can easily add new rights to specified access control lists.
20+
- path: examples/aclGet_OOP-1.lua
21+
description: This example adds a command <code>setaclright</code> with which you can easily add new rights to specified access control lists.
22+
oop: true
23+

functions/ACL/aclGetGroup.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclGetGroup
21
server:
32
name: aclGetGroup
4-
description: TODO
5-
incomplete: true
3+
description: This function is used to get the [[ACL]] group with the given name. If you need most of the groups you should consider using [[aclGroupList]] instead to get a [[table]] containing them all.
4+
oop:
5+
element: ACLGroup
6+
method: get
7+
static: true
8+
parameters:
9+
- name: groupName
10+
type: string
11+
description: The name to get the ACL group from.
12+
returns:
13+
values:
14+
- type: aclgroup|false
15+
name: acl group
16+
description: Returns the [[aclgroup]] if it could be found. Returns false/nil if it did not exist or failed for some reason.
17+
examples:
18+
- path: examples/aclGetGroup-1.lua
19+
description: This example makes every player able to use a command named <code>giveAccountAdminRights</code> that will add a specific accountname as an ACL object to the <code>Admin</code> group.
20+
- path: examples/aclGetGroup_OOP-1.lua
21+
description: This example makes every player able to use a command named <code>giveAccountAdminRights</code> that will add a specific accountname as an ACL object to the <code>Admin</code> group.
22+
oop: true
23+
- path: examples/aclGetGroup-2.lua
24+
description: This example displays a list of all the online admins in the chat box (assuming your administrator's group in your ACL is called 'Admin').
25+
- path: examples/aclGetGroup_OOP-2.lua
26+
description: This example displays a list of all the online admins in the chat box (assuming your administrator's group in your ACL is called 'Admin').
27+
oop: true

functions/ACL/aclGetName.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclGetName
21
server:
32
name: aclGetName
4-
description: TODO
5-
incomplete: true
3+
description: Get the name of given [[ACL]].
4+
oop:
5+
element: acl
6+
method: getName
7+
variable: name
8+
parameters:
9+
- name: theAcl
10+
type: acl
11+
description: The [[ACL]] to get the name of.
12+
returns:
13+
values:
14+
- type: string|false
15+
name: acl name
16+
description: Returns the name of the given [[ACL]] as a string if successful. Returns false/nil if unsuccessful, ie the ACL is invalid.
17+
examples:
18+
- path: examples/aclGetName-1.lua
19+
description: This example adds a command listacls which prints out a name list of all ACLs to the console.
20+
- path: examples/aclGetName_OOP-1.lua
21+
description: This example adds a command listacls which prints out a name list of all ACLs to the console.
22+
oop: true

functions/ACL/aclGetRight.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclGetRight
21
server:
32
name: aclGetRight
4-
description: TODO
5-
incomplete: true
3+
pair: aclSetRight
4+
description: This function returns whether the access for the given right is set to true or false in the [[ACL]].
5+
oop:
6+
element: acl
7+
method: getRight
8+
parameters:
9+
- name: theAcl
10+
type: acl
11+
description: The [[ACL]] to get the right from.
12+
- name: rightName
13+
type: string
14+
description: The right name to return the access value of.
15+
returns:
16+
values:
17+
- type: bool
18+
name: result
19+
description: Returns true or false if the [[ACL]] gives access or not to the given function. Returns nil if it failed for some reason, e.g. an invalid ACL was specified or the right specified does not exist in the ACL.
20+
examples:
21+
- path: examples/aclGetRight-1.lua
22+
description: This example lets players check if an ACL group has access to something or not.
23+
- path: examples/aclGetRight_OOP-1.lua
24+
description: This example lets players check if an ACL group has access to something or not.
25+
oop: true

functions/ACL/aclGroupAddACL.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclGroupAddACL
21
server:
32
name: aclGroupAddACL
4-
description: TODO
5-
incomplete: true
3+
description: |
4+
This function adds the given [[ACL]] to the given [ACL group](/reference/aclgroup). This makes the resources and players in the given ACL group have access to what's specified in the given ACL. The rights for something in the different ACL's in a group are OR-ed together, which means if one ACL gives access to something, this ACL group will have access to that.
5+
oop:
6+
element: aclgroup
7+
method: addACL
8+
parameters:
9+
- name: theGroup
10+
type: aclgroup
11+
description: The group to add the [[ACL]] to.
12+
- name: theAcl
13+
type: acl
14+
description: The [[ACL]] to add to the group.
15+
returns:
16+
values:
17+
- type: bool
18+
name: result
19+
description: Returns true if the [[ACL]] could be successfully added to the [ACL group](/reference/aclgroup), false/nil if either of the elements are invalid, the ACL is already in that group or if something else goes wrong.
20+
examples:
21+
- path: examples/aclGroupAddACL-1.lua
22+
description: This example adds a command <code>addAclGroup</code> with which you can easily add new access control lists to specified acl Groups.
23+
- path: examples/aclGroupAddACL_OOP-1.lua
24+
description: This example adds a command <code>addAclGroup</code> with which you can easily add new access control lists to specified acl Groups.
25+
oop: true

functions/ACL/aclGroupAddObject.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/aclGroupAddObject
21
server:
32
name: aclGroupAddObject
4-
description: TODO
5-
incomplete: true
3+
description: |
4+
This function adds an object to the given [ACL group](/reference/aclgroup). An object can be a player's account, specified as <code>user.<accountname></code>. Or a resource, specified as <code>resource.<resourcename></code>.
5+
Objects are specified as strings. The ACL groups work for the user accounts and the resources that are specified in them.
6+
oop:
7+
element: aclgroup
8+
method: addObject
9+
parameters:
10+
- name: theGroup
11+
type: aclgroup
12+
description: The group to add the object name string too.
13+
- name: theObject
14+
type: string
15+
description: The object string to add to the given [[ACL]].
16+
returns:
17+
values:
18+
- type: bool
19+
name: result
20+
description: Returns true if the object was successfully added to the [[ACL]], false if it already existed in the list.
21+
examples:
22+
- path: examples/aclGroupAddObject-1.lua
23+
description: This example makes every player able to use a command named <code>giveAccountAdminRights</code> that will add a specific accountname as an ACL object to the <code>Admin</code> group.
24+
- path: examples/aclGroupAddObject_OOP-1.lua
25+
description: This example makes every player able to use a command named <code>giveAccountAdminRights</code> that will add a specific accountname as an ACL object to the <code>Admin</code> group.
26+
oop: true

0 commit comments

Comments
 (0)