lib/rally_user_helper.rb
def parse_permission(name)
      if name.reverse.index(VIEWER.reverse)
        return VIEWER
      elsif name.reverse.index(EDITOR.reverse)
        return EDITOR
      elsif name.reverse.index(USER.reverse)
        return USER
      elsif name.reverse.index(ADMIN.reverse)
        return ADMIN
      else
        @logger.info "Error in parsing permission"
      end
      nil
    end
# Takes the name of the permission and returns the last token which is the permission
Takes the name of the permission and returns the last token which is the permission
Takes the name of the permission and returns the last token which is the permission
def parse_permission(name)
      if name.reverse.index(VIEWER.reverse)
        return VIEWER
      elsif name.reverse.index(EDITOR.reverse)
        return EDITOR
      elsif name.reverse.index(USER.reverse)
        return USER
      elsif name.reverse.index(ADMIN.reverse)
        return ADMIN
      else
        @logger.info "Error in parsing permission"
      end
      nil
    end
def parse_permission ( name ) if name . reverse . index ( VIEWER . reverse ) return VIEWER elsif name . reverse . index ( EDITOR . reverse ) return EDITOR elsif name . reverse . index ( USER . reverse ) return USER elsif name . reverse . index ( ADMIN . reverse ) return ADMIN else @logger . info "Error in parsing permission" end nil end
Takes the name of the permission and returns the last token which is the permission
Takes the name of the permission and returns the last token which is the permission
name