better-buddy-share-backend
    Preparing search index...

    Class RolesDAO

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Methods

    • Assign a permission to a role.

      Calls Assign_permission_to_role DB function and returns boolean result.

      Parameters

      • roleId: number

        Role ID

      • permissionId: number

        Permission ID

      Returns Promise<boolean>

      true when assigned, false otherwise

    • Create a new role by name.

      Calls the DB function Create_role and returns the created Role or null.

      Parameters

      • roleName: string

        Role name (uppercasing may be applied in DB call)

      Returns Promise<Role | null>

      The created Role or null

    • Delete a role by its numeric ID.

      Calls Delete_role_by_id DB function and returns boolean result.

      Parameters

      • roleId: number

        Numeric ID of the role to delete

      Returns Promise<boolean>

      true when deleted, false otherwise

    • Delete a role by its name.

      Calls Delete_role_by_name DB function and returns boolean result.

      Parameters

      • roleName: string

        Name of the role to delete

      Returns Promise<boolean>

      true when deleted, false otherwise

    • Revoke a permission from a role.

      Calls Revoke_permission_from_role DB function and returns boolean result.

      Parameters

      • roleId: number

        Role ID

      • permissionId: number

        Permission ID

      Returns Promise<boolean>

      true when revoked, false otherwise