def require_playable(handler):
 def test_can_play(self, exploration_id, **kwargs):
  if (exploration_id in feconf.DISABLED_EXPLORATION_IDS):
   self.render_template('pages/error/disabled_exploration.html', iframe_restriction=None)
   return
  if ((feconf.EXPLORATION_URL_EMBED_PREFIX in self.request.uri) or self.request.get('iframed')):
   self.values['iframed'] = True
  if rights_manager.Actor(self.user_id).can_play(feconf.ACTIVITY_TYPE_EXPLORATION, exploration_id):
   return handler(self, exploration_id, **kwargs)
  else:
   raise self.PageNotFoundException
 return test_can_play

def require_playable ( handler ) : def test_can_play ( self , exploration_id , ** kwargs ) : if ( exploration_id in feconf . DISABLED_EXPLORATION_IDS ) : self . render_template ( 'pages/error/disabled_exploration.html' , iframe_restriction = None ) return if ( ( feconf . EXPLORATION_URL_EMBED_PREFIX in self . request . uri ) or self . request . get ( 'iframed' ) ) : self . values [ 'iframed' ] = True if rights_manager . Actor ( self . user_id ) . can_play ( feconf . ACTIVITY_TYPE_EXPLORATION , exploration_id ) : return handler ( self , exploration_id , ** kwargs ) else : raise self . PageNotFoundException return test_can_play
decorator that checks if the user can play the given exploration .