def require_x_permission(flag)
      if current_user && current_user_roles.any?{|ug| ug.admin?}
        # if role is admin, then ok
      elsif current_user && current_model_permissions.any?{|cp| cp.permitted?(flag)}
        # if enough permission, then ok
      else
        respond_to_permission_error
      end
    end
def require_x_permission(flag)
      if current_user && current_user_roles.any?{|ug| ug.admin?}
        # if role is admin, then ok
      elsif current_user && current_model_permissions.any?{|cp| cp.permitted?(flag)}
        # if enough permission, then ok
      else
        respond_to_permission_error
      end
    end
common method for all of 'require_*_permission' before_filter