}
}
}
private int checkPermission( String module ) {
ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
if( module.equals( BLACKBERRY_APP ) ) {
return apm.getPermission( ApplicationPermissions.PERMISSION_APPLICATION_MANAGEMENT );
} else if( module.equals( BLACKBERRY_INVOKE ) || module.equals( BLACKBERRY_INVOKE_ADDRESSBOOKARGUMENTS )
|| module.equals( BLACKBERRY_INVOKE_BROWSERARGUMENTS ) || module.equals( BLACKBERRY_INVOKE_CALENDARARGUMENTS )
|| module.equals( BLACKBERRY_INVOKE_CAMERAARGUMENTS ) || module.equals( BLACKBERRY_INVOKE_JAVAARGUMENTS )
|| module.equals( BLACKBERRY_INVOKE_MAPSARGUMENTS ) || module.equals( BLACKBERRY_INVOKE_MESSAGEARGUMENTS )
|| module.equals( BLACKBERRY_INVOKE_PHONEARGUMENTS ) || module.equals( BLACKBERRY_INVOKE_SEARCHARGUMENTS )
|| module.equals( BLACKBERRY_INVOKE_TASKARGUMENTS ) ) {
return apm.getPermission( ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION );
} else if( module.equals( BLACKBERRY_IO_DIR ) || module.equals( BLACKBERRY_IO_FILE ) ) {
return apm.getPermission( ApplicationPermissions.PERMISSION_FILE_API );
} else if( module.equals( BLACKBERRY_MESSAGE ) ) {
return apm.getPermission( ApplicationPermissions.PERMISSION_EMAIL );
} else if( module.equals( BLACKBERRY_PIM_ADDRESS ) || module.equals( BLACKBERRY_PIM_APPOINTMENT )
|| module.equals( BLACKBERRY_PIM_ATTENDEE ) || module.equals( BLACKBERRY_PIM_CATEGORY )
|| module.equals( BLACKBERRY_PIM_CONTACT ) || module.equals( BLACKBERRY_PIM_MEMO )
|| module.equals( BLACKBERRY_PIM_RECURRENCE ) || module.equals( BLACKBERRY_PIM_REMINDER )
|| module.equals( BLACKBERRY_PIM_TASK ) ) {
return apm.getPermission( ApplicationPermissions.PERMISSION_ORGANIZER_DATA );
} else if( module.equals( BLACKBERRY_PUSH ) ) {
return apm.getPermission( ApplicationPermissions.PERMISSION_INTERNET );
}
return ApplicationPermissions.VALUE_ALLOW;
}