13 lines
323 B
JavaScript
13 lines
323 B
JavaScript
function CheckPermission(userID, isAdmin, admin = false) {
|
|
console.log(userID, isAdmin, admin);
|
|
|
|
if(userID === undefined || userID === null)
|
|
return false;
|
|
|
|
if(admin && (isAdmin === undefined || isAdmin === null || isAdmin == 0))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
export default CheckPermission; |