from flask_principal import Permission, RoleNeed
from waitlist.data.names import WTMRoles


perm_settings = Permission(RoleNeed(WTMRoles.fc), RoleNeed(WTMRoles.tbadge),
                             RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.lm),
                             RoleNeed(WTMRoles.resident), RoleNeed(WTMRoles.officer), RoleNeed(WTMRoles.dev), RoleNeed(WTMRoles.leadership))

perm_admin = Permission(RoleNeed(WTMRoles.admin))
perm_accounts = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.leadership), RoleNeed(WTMRoles.dev))

perm_management = Permission(RoleNeed(WTMRoles.fc), RoleNeed(WTMRoles.tbadge),
                             RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.lm), RoleNeed(WTMRoles.officer), RoleNeed(WTMRoles.leadership))

perm_officer = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.officer))

perm_feedback = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.officer), RoleNeed(WTMRoles.dev), RoleNeed(WTMRoles.leadership))

perm_dev = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.dev))

perm_leadership = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.leadership))

perm_fleetlocation = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.officer), RoleNeed(WTMRoles.leadership))

perm_bans = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.leadership), RoleNeed(WTMRoles.officer))

perm_viewfits = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.leadership), RoleNeed(WTMRoles.officer),
                            RoleNeed(WTMRoles.fc), RoleNeed(WTMRoles.lm), RoleNeed(WTMRoles.tbadge), RoleNeed(WTMRoles.resident))
perm_comphistory = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.fc), RoleNeed(WTMRoles.lm))

perm_access_mod_mail = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.mod_mail_resident), RoleNeed(WTMRoles.mod_mail_tbadge))

perm_mod_mail_resident = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.mod_mail_resident))
perm_mod_mail_tbadge = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.mod_mail_tbadge))

perm_send_mail_tbadge = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.send_mail_tbadge))
perm_send_mail_resident = Permission(RoleNeed(WTMRoles.admin), RoleNeed(WTMRoles.send_mail_resident))
@@ -1705,16 +1705,43 @@
 oles.lm)
+, RoleNeed(WTMRoles.tbadge)
 )%0A%0Aperm_

add ability for tbadges to access comphistory