Skip to content
Peter edited this page Mar 19, 2024 · 2 revisions
_G.user

Overview

Functions

Signature Return Description
sudo(psw) boolean Set user as super user
isSu() boolean Check if the current user is the super user
setSuPass(cPass, nPass) boolean Set the super user password
hasPerm(perm) boolean Check if the current user has the specified permission
changeUser(name, pass) boolean Change the current user
getUser() string Get the current user name

Classes

LocalUser

RemoteUser

Detail

Functions

sudo

_G.user.sudo(psw: string): boolean

Set user as super user

Parameters

  • psw: sting - Password

Returns

  • isSu: boolean - If the user is now super user

isSu

_G.user.isSu(): boolean

Check if the current user is the super user

Returns

  • isSu: boolean - If the user is currently super user

setSuPass

_G.user.setSuPass(cPass: string, nPass: string): boolean

Set the super user password

Parameters

  • cPass: string - Current password
  • nPass: string - New Password

Returns

  • changed: boolean - If the password was changed

hasPerm

_G.user.hasPerm(perm: string): boolean

Check if the current user has the specified permission

Parameters

  • perm: string - Permission to check for

Returns

  • has: boolean

``

_G.user.(name: string, pass: string): boolean

Change the current user

Parameters

  • name: string - New username
  • pass: string - New user password

Returns

  • changed: boolean

getUser

_G.user.getUser(): string

Get the current user name. DOES NOT GET SUPER USER

Returns

  • user: string

Clone this wiki locally