Esempio n. 1
0
 /**
  * Returns true if current user may delete this group.
  * 
  * @return	boolean
  */
 public function isDeletable()
 {
     // insufficient permissions
     if (!WCF::getSession()->getPermission('admin.user.canDeleteGroup')) {
         return false;
     }
     // cannot delete own groups
     if (UserGroup::isMember($this->groupID)) {
         return false;
     }
     // user cannot delete this group
     if (!UserGroup::isAccessibleGroup(array($this->groupID))) {
         return false;
     }
     // cannot delete static groups
     if ($this->groupType == UserGroup::EVERYONE || $this->groupType == UserGroup::GUESTS || $this->groupType == UserGroup::USERS) {
         return false;
     }
     return true;
 }