Skip to content

Commit

Permalink
Merge pull request #78 from jfederico/master
Browse files Browse the repository at this point in the history
Implemented filter for allowing restricted access to extra recording formats
  • Loading branch information
jfederico authored Dec 15, 2017
2 parents 06b605f + b915092 commit 8e89412
Show file tree
Hide file tree
Showing 16 changed files with 377 additions and 240 deletions.
12 changes: 10 additions & 2 deletions api/src/java/org/sakaiproject/bbb/api/BBBMeetingManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public interface BBBMeetingManager {
public final static String CFG_GROUPSESSIONS_DEFAULT = "bbb.groupsessions.default";
public final static String CFG_RECORDINGSTATS_ENABLED = "bbb.recordingstats.enabled";
public final static String CFG_RECORDINGSTATS_USERID = "bbb.recordingstats.userid";
public final static String CFG_RECORDINGFORMATFILTER_ENABLED = "bbb.recordingformatfilter.enabled";
public final static String CFG_RECORDINGFORMATFILTER_WHITELIST = "bbb.recordingformatfilter.whitelist";

// Permissions
public static final String FN_PREFIX = "bbb.";
Expand All @@ -82,10 +84,13 @@ public interface BBBMeetingManager {
public static final String FN_RECORDING_EDIT_ANY = "bbb.recording.edit.any";
public static final String FN_RECORDING_DELETE_OWN = "bbb.recording.delete.own";
public static final String FN_RECORDING_DELETE_ANY = "bbb.recording.delete.any";
public static final String FN_RECORDING_EXTENDEDFORMATS_OWN = "bbb.recording.extendedformats.own";
public static final String FN_RECORDING_EXTENDEDFORMATS_ANY = "bbb.recording.extendedformats.any";
public static final String[] FUNCTIONS = new String[] { FN_CREATE,
FN_EDIT_OWN, FN_EDIT_ANY, FN_DELETE_OWN, FN_DELETE_ANY, FN_PARTICIPATE,
FN_RECORDING_VIEW, FN_RECORDING_EDIT_OWN, FN_RECORDING_EDIT_ANY,
FN_RECORDING_DELETE_OWN, FN_RECORDING_DELETE_ANY };
FN_RECORDING_DELETE_OWN, FN_RECORDING_DELETE_ANY,
FN_RECORDING_EXTENDEDFORMATS_OWN, FN_RECORDING_EXTENDEDFORMATS_ANY };
// Extra function used to enable admin interface in the client
public static final String FN_ADMIN = "bbb.admin";

Expand Down Expand Up @@ -175,7 +180,7 @@ public Map<String, Object> getMeetingInfo(String meetingID, String groupId)
/**
* Get playback recordings from BBB server.
*/
public Map<String, Object> getRecordings(String meetingID, String groupId)
public Map<String, Object> getRecordings(String meetingID, String groupId, String siteId)
throws BBBException;

/**
Expand Down Expand Up @@ -375,4 +380,7 @@ public String getJoinUrl(BBBMeeting meeting, User user)

public List<String> getUserGroupIdsInSite(String userId, String siteId);

public boolean isRecordingFormatFilterEnabled();

public String getRecordingFormatFilterWhitelist();
}
6 changes: 6 additions & 0 deletions bundle/src/resources/ToolMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ bbb_recording_status_hidden = Unpublished
bbb_recording_status_shown = Published
bbb_recording_thumbnails_hidden = Only for published recordings
bbb_recording_type.presentation = Presentation
bbb_recording_type.video = Video
bbb_recording_type.statistics = Statistics
bbb_recording_view_tooltip.presentation = View the presentation
bbb_recording_view_tooltip.video = View the video
bbb_recording_view_tooltip.statistics = View the statistics


#####################################
Expand Down Expand Up @@ -160,6 +164,8 @@ bbb_permissions_recordings_edit_own = Edit own recordings
bbb_permissions_recordings_edit_any = Edit any recordings
bbb_permissions_recordings_delete_own = Delete own recordings
bbb_permissions_recordings_delete_any = Delete any recordings
bbb_permissions_recordings_extendedformats_own = View extended formats in own recordings
bbb_permissions_recordings_extendedformats_any = View extended formats in any recordings


#####################################
Expand Down
2 changes: 2 additions & 0 deletions bundle/src/resources/ToolMessages_ca_ES.properties
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,11 @@ bbb_recording_thumbnails_hidden = Nom\u00E9s per gravacions publicades

bbb_recording_type.presentation = Presentaci\u00F3
bbb_recording_type.video = V\u00EDdeo
bbb_recording_type.statistics = Estad\u00EDsticas

bbb_recording_view_tooltip.presentation = Mostra la presentaci\u00F3
bbb_recording_view_tooltip.video = Mostra el V\u00EDdeo
bbb_recording_view_tooltip.statistics = Mostra las Estad\u00EDsticas

bbb_recordings_label = Gravacions

Expand Down
6 changes: 6 additions & 0 deletions bundle/src/resources/ToolMessages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ bbb_recording_status_hidden = Unpublished
bbb_recording_status_shown = Published
bbb_recording_thumbnails_hidden = Only for published recordings
bbb_recording_type.presentation = Presentation
bbb_recording_type.video = Video
bbb_recording_type.statistics = Statistics
bbb_recording_view_tooltip.presentation = View the presentation
bbb_recording_view_tooltip.video = View the video
bbb_recording_view_tooltip.statistics = View the statistics


#####################################
Expand Down Expand Up @@ -160,6 +164,8 @@ bbb_permissions_recordings_edit_own = Edit own recordings
bbb_permissions_recordings_edit_any = Edit any recordings
bbb_permissions_recordings_delete_own = Delete own recordings
bbb_permissions_recordings_delete_any = Delete any recordings
bbb_permissions_recordings_extendedformats_own = View extended formats in own recordings
bbb_permissions_recordings_extendedformats_any = View extended formats in any recordings


#####################################
Expand Down
6 changes: 6 additions & 0 deletions bundle/src/resources/ToolMessages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ bbb_recording_status_hidden = Unpublished
bbb_recording_status_shown = Published
bbb_recording_thumbnails_hidden = Only for published recordings
bbb_recording_type.presentation = Presentation
bbb_recording_type.video = Video
bbb_recording_type.statistics = Statistics
bbb_recording_view_tooltip.presentation = View the presentation
bbb_recording_view_tooltip.video = View the video
bbb_recording_view_tooltip.statistics = View the statistics


#####################################
Expand Down Expand Up @@ -160,6 +164,8 @@ bbb_permissions_recordings_edit_own = Edit own recordings
bbb_permissions_recordings_edit_any = Edit any recordings
bbb_permissions_recordings_delete_own = Delete own recordings
bbb_permissions_recordings_delete_any = Delete any recordings
bbb_permissions_recordings_extendedformats_own = View extended formats in own recordings
bbb_permissions_recordings_extendedformats_any = View extended formats in any recordings


#####################################
Expand Down
6 changes: 6 additions & 0 deletions bundle/src/resources/ToolMessages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ bbb_recording_status_hidden = No publicada
bbb_recording_status_shown = Publicada
bbb_recording_thumbnails_hidden = Solo para grabaciones publicadas
bbb_recording_type.presentation = Presentaci\u00F3n
bbb_recording_type.video = Video
bbb_recording_type.statistics = Estad\u00EDsticas
bbb_recording_view_tooltip.presentation = Ver la presentaci\u00F3n
bbb_recording_view_tooltip.video = Ver el V\u00EDdeo
bbb_recording_view_tooltip.statistics = Ver las Estad\u00EDsticas


#####################################
Expand Down Expand Up @@ -161,6 +165,8 @@ bbb_permissions_recordings_edit_own = Editar grabaciones propias
bbb_permissions_recordings_edit_any = Editar cualquier grabaci\u00F3n
bbb_permissions_recordings_delete_own = Eliminar grabaciones propias
bbb_permissions_recordings_delete_any = Eliminar cualquier grabaci\u00F3n
bbb_permissions_recordings_extendedformats_own = Ver formatos extendidos de grabaciones propias
bbb_permissions_recordings_extendedformats_any = Ver formatos extendidos de cualquier grabaci\u00F3n


#####################################
Expand Down
11 changes: 11 additions & 0 deletions bundle/src/resources/ToolMessages_es_MX.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ bbb_action_delete_recording_question = \u003FEst\u00E1s segura(o) de querer elim
bbb_recording_status_hidden = No publicada
bbb_recording_status_shown = Publicada
bbb_recording_type.presentation = Presentaci\u00F3n
bbb_recording_type.video = Video
bbb_recording_type.statistics = Estad\u00EDsticas
bbb_recording_view_tooltip.presentation = Ver la presentaci\u00F3n
bbb_recording_view_tooltip.video = Ver el V\u00EDdeo
bbb_recording_view_tooltip.statistics = Ver las Estad\u00EDsticas


#####################################
Expand Down Expand Up @@ -143,6 +147,13 @@ bbb_permissions_delete_own = Eliminar las propias
bbb_permissions_edit_any = Editar cualquiera
bbb_permissions_edit_own = Editar las propias
bbb_permissions_participate = Participar
bbb_permissions_recordings_view = Ver grabaciones
bbb_permissions_recordings_edit_own = Editar grabaciones propias
bbb_permissions_recordings_edit_any = Editar cualquier grabaci\u00F3n
bbb_permissions_recordings_delete_own = Eliminar grabaciones propias
bbb_permissions_recordings_delete_any = Eliminar cualquier grabaci\u00F3n
bbb_permissions_recordings_extendedformats_own = Ver formatos extendidos de grabaciones propias
bbb_permissions_recordings_extendedformats_any = Ver formatos extendidos de cualquier grabaci\u00F3n


#####################################
Expand Down
42 changes: 26 additions & 16 deletions default.sakai.properties
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@
# DEFAULT: fckeditor
# bbb.descriptiontype=

# Set up to [true/false] to enable or disable the recording capability for all meetings.
# Set up to [true|false] to enable or disable the recording capability for all meetings.
# When enabled, its setting can be changed for each meeting using the Add/Edit user interface.
# This parameter replaces the bbb.recording parameter introduced in 1.0.7.
# DEFAULT: true
# bbb.recording.enabled=

# Set up to [true/false] to show or hide the 'recording' checkbox for meetings when created/edited.
# Set up to [true|false] to show or hide the 'recording' checkbox for meetings when created/edited.
# This feature can be used to enforce recordings for all meetings (by setting enabled and default to true and, editable to false),
# however this will not enforce recordings for meetings created before this change.
# DEFAULT: true
# bbb.recording.editable=

# Set up to [true/false] the default 'recording' setting for the meetings when created.
# Set up to [true|false] the default 'recording' setting for the meetings when created.
# When a meeting has this setting enabled, the sessions will be created with recording capabilities.
# DEFAULT: false
# bbb.recording.default=

# Set up to [true/false] to enable or disable the duration capability for all meetings. When enabled, its value can be changed for each meeting using the Add/Edit user interface.
# Set up to [true|false] to enable or disable the duration capability for all meetings. When enabled, its value can be changed for each meeting using the Add/Edit user interface.
# DEFAULT: false
# bbb.duration.enabled=

Expand All @@ -96,67 +96,67 @@
# DEFAULT: 120
# bbb.duration.default=

# Set up to [true/false] to enable or disable the waiting for moderator capability for all meetings.
# Set up to [true|false] to enable or disable the waiting for moderator capability for all meetings.
# When enabled, its value can be changed for each meeting using the Add/Edit user interface.
# DEFAULT: true
# bbb.waitmoderator.enabled=

# Set up to [true/false] to show or hide the 'wait for moderator' checkbox for meetings when created/edited.
# Set up to [true|false] to show or hide the 'wait for moderator' checkbox for meetings when created/edited.
# This feature can be used to enforce 'wait for moderator' for all meetings (by setting enabled and default to true and, editable to false),
# however this will not enforce 'wait for moderator' for meetings created before this change.
# DEFAULT: true
# bbb.waitmoderator.editable=

# Set up to [true/false] the default 'wait for moderator' setting for the meetings when created.
# Set up to [true|false] the default 'wait for moderator' setting for the meetings when created.
# When a meeting has this setting enabled, all users in the viewer role will not be able to join the session until a user with the moderator role joins.
# DEFAULT: true
# bbb.waitmoderator.default=

# Set up to [true/false] to enable or disable the 'multiple sessions allowed' capability for all meetings.
# Set up to [true|false] to enable or disable the 'multiple sessions allowed' capability for all meetings.
# When enabled, its value can be changed for each meeting using the Add/Edit user interface.
# DEFAULT: false
# bbb.multiplesessionsallowed.enabled=

# Set up to [true/false] to show or hide the 'multiple sessions allowed' checkbox for meetings when created/edited.
# Set up to [true|false] to show or hide the 'multiple sessions allowed' checkbox for meetings when created/edited.
# This feature can be used to enforce 'multiple sessions allowed' for all meetings (by setting enabled and default to true, and editable to false),
# however this will not enforce 'multiple sessions allowed' for meetings created before this change.
# DEFAULT: true
# bbb.multiplesessionsallowed.editable=

# Set up to [true/false] the default 'multiple sessions allowed' setting for the meetings when created.
# Set up to [true|false] the default 'multiple sessions allowed' setting for the meetings when created.
# When a meeting has this setting enabled, users will be able to join the same sessions in multiple tabs.
# DEFAULT: false
# bbb.multiplesessionsallowed.default=

# Set up to [true/false] to enable or disable the 'preupload presentation' capability for all meetings.
# Set up to [true|false] to enable or disable the 'preupload presentation' capability for all meetings.
# When enabled, presentations can be preuploaded to the meeting if a file is chosen in the Add/Edit user interface.
# DEFAULT: true
# bbb.preuploadpresentation.enabled=

# Set up to [true/false] to enable or disable the 'group sessions' capability for all meetings.
# Set up to [true|false] to enable or disable the 'group sessions' capability for all meetings.
# When enabled, its value can be changed for each meeting using the Add/Edit user interface.
# DEFAULT: true
# bbb.groupsessions.enabled=

# Set up to [true/false] to show or hide the 'group sessions' checkbox for meetings when created/edited.
# Set up to [true|false] to show or hide the 'group sessions' checkbox for meetings when created/edited.
# This feature can be used to enforce 'group sessions' for all meetings (by setting enabled and default to true, and editable to false),
# however this will not enforce 'group sessions' for meetings created before this change.
# DEFAULT: true
# bbb.groupsessions.editable=

# Set up to [true/false] the default 'group sessions' setting for the meetings when created.
# Set up to [true|false] the default 'group sessions' setting for the meetings when created.
# When a meeting has this setting enabled, users will be able to join group-only sessions for the meeting.
# DEFAULT: false
# bbb.groupsessions.default=

## Special settings
# #########
# ################################################################################################################################################ #
# BigBlueButton can be extended in many different ways. A common way to gain some extra capabilities is by adding ruby scripts that are executed
# while the recording is processed http://docs.bigbluebutton.org/dev/recording.html#post-scripts.
# Common uses for this are: sending messages when the recording is ready, gattering information that may be used for analitycs etc.
# Although these features are not standard, there are a few minor tweaks that can be enabled by configuration in Sakai so BigBlueButton
# administrators can implement actions over extra information received through the meta parameters.
# #########
# ################################################################################################################################################ #

# Send a messages through Sakai when the recording is ready.
# When enabled, a meta_bn-recording-ready-url parameter is included as part of the create request. It contains an URL that can be used by BigBlueButton
Expand All @@ -173,3 +173,13 @@
# The default value for userid is the Sakai user.eid but also the user_id could be used instead.
# DEFAULT: eid [eid|user_id]
# bbb.recordingstats.userid=

# Set up to [true|false] a filter to be applied to recording formats when the BBB server provides more than one
# DEFAULT: true
# bbb.recordingformatfilter.enabled=

# List (comma separated) of recording formats that will be whitelisted.
# The whitelisted formats are shown to all the users who have permissions to view recordings. All the other formats
# are considered as Extra Formats and have to be enabled per role through the permissions.
# DEFAULT: presentation,video
# bbb.recordingformatfilter.whitelist=
29 changes: 14 additions & 15 deletions impl/src/java/org/sakaiproject/bbb/impl/BBBAPIWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ public class BBBAPIWrapper/* implements Runnable */{
private boolean bbbRecordingStatsEnabled = false;
/** Sakai userid used for linking events with users when 'recording status' feature is enabled (default to eid) */
private String bbbRecordingStatsUserId = "eid";
/** BBB flag to activate/deactivate 'recording format filter' feature for managing permissions on extended formats (default to true) */
private boolean bbbRecordingFormatFilterEnabled = true;
/** BBB list of formats allowed to be seen whotout applying a permissions filter (default to presentation,video) */
private String bbbRecordingFormatFilterWhitelist = "presentation,video";

/** BBB API */
private BBBAPI api = null;
Expand Down Expand Up @@ -169,7 +173,8 @@ public void start() {
bbbGroupSessionsEditable = (boolean) config.getBoolean(BBBMeetingManager.CFG_GROUPSESSIONS_EDITABLE, bbbGroupSessionsEditable);
bbbGroupSessionsDefault = (boolean) config.getBoolean(BBBMeetingManager.CFG_GROUPSESSIONS_DEFAULT, bbbGroupSessionsDefault);
bbbRecordingStatsEnabled = (boolean) config.getBoolean(BBBMeetingManager.CFG_RECORDINGSTATS_ENABLED, bbbRecordingStatsEnabled);
bbbRecordingStatsUserId = (String) config.getString(BBBMeetingManager.CFG_RECORDINGSTATS_USERID, bbbRecordingStatsUserId);
bbbRecordingFormatFilterEnabled = (boolean) config.getBoolean(BBBMeetingManager.CFG_RECORDINGFORMATFILTER_ENABLED, bbbRecordingFormatFilterEnabled);
bbbRecordingFormatFilterWhitelist = (String) config.getString(BBBMeetingManager.CFG_RECORDINGFORMATFILTER_WHITELIST, bbbRecordingFormatFilterWhitelist);
}

public void destroy() {
Expand Down Expand Up @@ -293,20 +298,6 @@ public Map<String, Object> getRecordings(String meetingID)
return recordingsResponse;
}

public Map<String, Object> getSiteRecordings(String meetingIDs)
throws BBBException {
if (logger.isDebugEnabled()) logger.debug("getSiteRecordings(): for meetingIDs=" + meetingIDs);

return getRecordings(meetingIDs);
}

public Map<String, Object> getAllRecordings()
throws BBBException {
if (logger.isDebugEnabled()) logger.debug("getAllRecordings()");

return getRecordings("");
}

public boolean endMeeting(String meetingID, String password)
throws BBBException {
if (logger.isDebugEnabled()) logger.debug("endMeeting()");
Expand Down Expand Up @@ -468,6 +459,14 @@ public String getRecordingStatsUserId() {
return bbbRecordingStatsUserId;
}

public boolean isRecordingFormatFilterEnabled() {
return bbbRecordingFormatFilterEnabled;
}

public String getRecordingFormatFilterWhitelist() {
return bbbRecordingFormatFilterWhitelist;
}

private Map<String, Object> responseError(String messageKey, String message) {
logger.debug("responseError: " + messageKey + ":" + message);

Expand Down
Loading

0 comments on commit 8e89412

Please sign in to comment.