g_user Object Properties and Methods

  • g_user properties
    • firstName
    • lastName
    • userID
  • g_user methods
    • getClientData()
    • getFullName()
    • hasRole()
    • hasRoleExactly()
    • hasRoleFromFromList() // possible typo
  • g_user property syntax
    • g_user. <property>
  • g_user method syntax
    • g__user.<method__name>

Description

  • getClientData() — returns the session client value previously set with the putClientData() method.
  • getFuIlName() — returns the logged in user's first name and last name separated by a space.
  • hasRole() — returns true if the logged in user has the specified role or has the admin role.
  • hasRoIeExactIy() — returns true only if the logged in user has the specified role.
  • hasRoIeFromList() — returns true if the logged in user has at least one role from the passed in list or

    has the admin role.

  • hasRoIes() — returns true if the logged in user has any role.

IMPORTANT

DO NOT rely on g_ user methods to apply security.

Client-side security is easily defeated using developer tools built into browsers. Access Control or another server-side security strategy is recommended.

results matching ""

    No results matching ""