πŸŸͺsam.Rank.inherits_from

bool sam.Rank.inherits_from( string rank_name_1, string rank_name_2 )

Description

Check if rank 1 inherits from rank 2 or not.

This function will trace down to user, check examples.

Aguments

  1. string rank_name_1

  2. string rank_name_2

Returns

Examples

-- superadmin
--    admin
--        user
print(sam.Rank.inherits_from("superadmin", "superadmin")) -- true
print(sam.Rank.inherits_from("superadmin", "admin")) -- true
print(sam.Rank.inherits_from("superadmin", "user")) -- true

print(sam.Rank.inherits_from("admin", "superadmin")) -- false
print(sam.Rank.inherits_from("admin", "admin")) -- true
print(sam.Rank.inherits_from("admin", "user")) -- true

Last updated