VRFS-2256 allow invited and approved RSVP users to join approval_required sessions without having to send a join request

This commit is contained in:
Brian Smith 2014-11-05 21:54:08 -05:00
parent df9352d608
commit 415805c4eb
4 changed files with 10 additions and 17 deletions

View File

@ -135,8 +135,7 @@
});
if (showJoinLink) {
// wire up the Join Link to the T&Cs dialog
// wire up the Join Link to the T&Cs dialog
$('.join-link', $parentRow).click(function(evt) {
if(!context.JK.guardAgainstBrowser(app)) {
return false;

View File

@ -138,22 +138,8 @@
return;
}
if ("invitations" in session) {
var invitation;
// user has invitations for this session
for (var i=0; i < session.invitations.length; i++) {
invitation = session.invitations[i];
// session contains an invitation for this user
if (invitation.receiver_id === context.JK.currentUserId) {
hasInvitation = true;
break;
}
}
}
if (session) {
// if user has an invitation, always open terms and allow joining regardless of settings
if (hasInvitation) {
if (session.can_join) {
logger.debug("Found invitation for user " + context.JK.currentUserId + ", session " + sessionId);
openJoinSessionTerms(sessionId);
}

View File

@ -15,6 +15,10 @@ else
attributes :id, :name, :description, :musician_access, :approval_required, :fan_access, :fan_chat, :band_id, :user_id, :claimed_recording_initiator_id, :track_changes_counter, :max_score
node :can_join do |session|
session.can_join?(current_user, true)
end
node :genres do |item|
[item.genre.description] # XXX: need to return single genre; not array
end

View File

@ -21,6 +21,10 @@ else
:language, :recurring_mode, :language_description, :scheduled_start_date, :access_description, :timezone, :timezone_id, :timezone_description,
:musician_access_description, :fan_access_description, :session_removed_at, :legal_policy, :open_rsvps, :is_unstructured_rsvp?
node :can_join do |session|
session.can_join?(current_user, true)
end
node :share_url do |history|
unless history.share_token.nil?
share_token_url(history.share_token.token)