Skip to content

Properly optimize Warden.CheckPermission #14

@textstack

Description

@textstack

Warden.CheckPermission is probably the most important function the addon has, but it probably needs to be rewritten to improve its efficiency. There is quite a lot this function needs to do, and in a particular order:

  1. get the permission object and owners
  2. check if the permission should be cancelled by touch settings
  3. check all of the following conditions for both whitelist and the current permission:
    3.1. check for any entity filters set by the server -> check if the receiver bypasses the filter with admin level
    3.2. check if the receiver bypasses permissions with admin level
    3.3. check if the granter is a bot and whether bots should get their permissions bypassed
    3.4. check if the receiver or granter is the world
    3.5. check if the receiver and granter are both valid
    3.6. check if another addon overrides perms
    3.7. check if the receiver and granter are the same person
    3.8. check if the permission is enabled
    3.9. check if the granter has persistent perms enabled (to determine the default setting for global-set perms)
    3.10. check if the perm's global setting matches its local setting

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions